summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-03-16 22:46:49 +0000
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-03-16 22:46:49 +0000
commit38dcab246c58c2088c3ec2aed6e632dae6a8467d (patch)
tree64aefc119ccfd9b6a26a174c518c9131e80badd8 /src
parent9c8d1c5851fbe93e986bbf7e0fbe16c7592b58fa (diff)
downloadxine-lib-38dcab246c58c2088c3ec2aed6e632dae6a8467d.tar.gz
xine-lib-38dcab246c58c2088c3ec2aed6e632dae6a8467d.tar.bz2
Actually, drv3.so.6.0 is still needed to be checked for the Alpha codecs, but as those are the oldest ones, check drvc.so for autodetection, only.
CVS patchset: 8689 CVS date: 2007/03/16 22:46:49
Diffstat (limited to 'src')
-rw-r--r--src/libreal/real_common.c20
-rw-r--r--src/libreal/real_common.h5
-rw-r--r--src/libreal/xine_decoder.c10
3 files changed, 24 insertions, 11 deletions
diff --git a/src/libreal/real_common.c b/src/libreal/real_common.c
index 29aacbd8c..28c37c33e 100644
--- a/src/libreal/real_common.c
+++ b/src/libreal/real_common.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: real_common.c,v 1.8 2007/03/16 22:28:48 dgp85 Exp $
+ * $Id: real_common.c,v 1.9 2007/03/16 22:46:49 dgp85 Exp $
*
* Common function for the thin layer to use Real binary-only codecs in xine
*/
@@ -76,7 +76,7 @@ void _x_real_codecs_init(xine_t *const xine) {
struct stat s;
#define try_real_path(path) \
- if ( !stat (path "/dvr3.so.6.0", &s) || !stat (path "/dvrc.so", &s) ) \
+ if (!stat (path "/dvrc.so", &s)) \
default_real_codecs_path = path;
#define try_real_subpath(path) \
try_real_path("/usr/" path) \
@@ -105,7 +105,7 @@ void _x_real_codecs_init(xine_t *const xine) {
_("If you have RealPlayer installed, specify the path "
"to its codec directory here. You can easily find "
"the codec directory by looking for a file named "
- "\"drv3.so.6.0\" in it. If xine can find the RealPlayer "
+ "\"drvc.so\" in it. If xine can find the RealPlayer "
"codecs, it will use them to decode RealPlayer content "
"for you. Consult the xine FAQ for more information on "
"how to install the codecs."),
@@ -115,7 +115,8 @@ void _x_real_codecs_init(xine_t *const xine) {
}
void *_x_real_codec_open(xine_stream_t *const stream, const char *const path,
- const char *const codec_name) {
+ const char *const codec_name,
+ const char *const codec_alternate) {
char *codecpath = NULL;
void *codecmodule = NULL;
@@ -140,6 +141,17 @@ void *_x_real_codec_open(xine_stream_t *const stream, const char *const path,
free(codecpath);
+ if ( codec_alternate ) {
+ asprintf(&codecpath, "%s/%s", path, codec_alternate);
+ if ( (codecmodule = dlopen(codecpath, RTLD_NOW)) ) {
+ free(codecpath);
+ return codecmodule;
+ }
+
+ xprintf (stream->xine, XINE_VERBOSITY_DEBUG,
+ LOG_MODULE ": error loading %s: %s\n", codecpath, dlerror());
+ }
+
_x_message(stream, XINE_MSG_LIBRARY_LOAD_ERROR, codec_name, NULL);
return NULL;
diff --git a/src/libreal/real_common.h b/src/libreal/real_common.h
index fd27ce5cf..86cf4a63f 100644
--- a/src/libreal/real_common.h
+++ b/src/libreal/real_common.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: real_common.h,v 1.4 2007/03/16 21:37:58 dgp85 Exp $
+ * $Id: real_common.h,v 1.5 2007/03/16 22:46:49 dgp85 Exp $
*
* Common function for the thin layer to use Real binary-only codecs in xine
*/
@@ -56,6 +56,7 @@ void __ctype_b(void) EXPORTED;
void _x_real_codecs_init(xine_t *const xine);
void *_x_real_codec_open(xine_stream_t *const stream, const char *const path,
- const char *const codec_name);
+ const char *const codec_name,
+ const char *const codec_alternate);
#endif
diff --git a/src/libreal/xine_decoder.c b/src/libreal/xine_decoder.c
index b08222a9a..761b4bfc2 100644
--- a/src/libreal/xine_decoder.c
+++ b/src/libreal/xine_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.89 2007/03/16 21:37:58 dgp85 Exp $
+ * $Id: xine_decoder.c,v 1.90 2007/03/16 22:46:49 dgp85 Exp $
*
* thin layer to use real binary-only codecs in xine
*
@@ -109,12 +109,12 @@ void __pure_virtual(void);
* real codec loader
*/
-static int load_syms_linux (realdec_decoder_t *this, const char *codec_name) {
+static int load_syms_linux (realdec_decoder_t *this, const char *codec_name, const char *const codec_alternate = NULL) {
cfg_entry_t* entry =
this->stream->xine->config->lookup_entry(this->stream->xine->config,
"decoder.external.real_codecs_path");
- if ( (this->rv_handle = _x_real_codec_open(this->stream, entry->str_value, codec_name)) == NULL )
+ if ( (this->rv_handle = _x_real_codec_open(this->stream, entry->str_value, codec_name, codec_alternate)) == NULL )
return 0;
this->rvyuv_custom_message = dlsym (this->rv_handle, "RV20toYUV420CustomMessage");
@@ -163,12 +163,12 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) {
break;
case BUF_VIDEO_RV30:
_x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Real Video 3.0");
- if (!load_syms_linux (this, "drvc.so"))
+ if (!load_syms_linux (this, "drvc.so", "drv3.so.6.0"))
return 0;
break;
case BUF_VIDEO_RV40:
_x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Real Video 4.0");
- if (!load_syms_linux(this, "drvc.so"))
+ if (!load_syms_linux(this, "drvc.so", "drv3.so.6.0"))
return 0;
break;
default: