From 38dcab246c58c2088c3ec2aed6e632dae6a8467d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Fri, 16 Mar 2007 22:46:49 +0000 Subject: 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 --- src/libreal/real_common.c | 20 ++++++++++++++++---- src/libreal/real_common.h | 5 +++-- src/libreal/xine_decoder.c | 10 +++++----- 3 files changed, 24 insertions(+), 11 deletions(-) (limited to 'src') 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: -- cgit v1.2.3