diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-10-20 01:58:43 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-10-20 02:16:35 +0300 |
commit | 3595dcc0896c6e3d117510b3361d75568cfa5f8e (patch) | |
tree | 3df8fad5fb02dc9cc3a57b4640f6e11d0d45e471 | |
parent | 49b2bc59477395370065a22ecbe05a36c246bc73 (diff) | |
download | mpv-3595dcc0896c6e3d117510b3361d75568cfa5f8e.tar.bz2 mpv-3595dcc0896c6e3d117510b3361d75568cfa5f8e.tar.xz |
audio/video: delete buggy "dynamic plugin" code
Codec selection for audio and video decoding had a "dynamic plugin"
feature that tried to load a shared library for any codec that had not
been enabled at compilation (disabled by default, but could be enabled
with --enable-dynamic-plugins configure switch; for unknown reasons
some distro packages have enabled it). The implementation was buggy
and could cause normal codec selection fallback to fail if the feature
was enabled. I'm not aware of any real uses of such dynamic plugins
and the feature seems questionable anyway (there are no ABI guarantees
that would make it safe to use). Remove the buggy feature.
-rwxr-xr-x | configure | 18 | ||||
-rw-r--r-- | libmpcodecs/dec_audio.c | 44 | ||||
-rw-r--r-- | libmpcodecs/dec_video.c | 44 | ||||
-rw-r--r-- | libmpdemux/stheader.h | 6 |
4 files changed, 0 insertions, 112 deletions
@@ -496,7 +496,6 @@ Advanced options: --enable-profile compile-in profiling information [disable] --disable-sighandler disable sighandler for crashes [enable] --enable-crash-debug enable automatic gdb attach on crash [disable] - --enable-dynamic-plugins enable dynamic A/V plugins [disable] Use these options if autodetection fails: --extra-cflags=FLAGS extra CFLAGS @@ -672,7 +671,6 @@ _bl=no _shm=auto _translation=no _charset="UTF-8" -_dynamic_plugins=no _crash_debug=no _sighandler=yes _libdv=auto @@ -843,8 +841,6 @@ for ac_option do --disable-cross-compile) _cross_compile=no ;; --enable-mplayer) _mplayer=yes ;; --disable-mplayer) _mplayer=no ;; - --enable-dynamic-plugins) _dynamic_plugins=yes ;; - --disable-dynamic-plugins) _dynamic_plugins=no ;; --enable-x11) _x11=yes ;; --disable-x11) _x11=no ;; --enable-xshape) _xshape=yes ;; @@ -3104,18 +3100,6 @@ fi echores "$_dl" -echocheck "dynamic a/v plugins support" -if test "$_dl" = no ; then - _dynamic_plugins=no -fi -if test "$_dynamic_plugins" = yes ; then - def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1' -else - def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS' -fi -echores "$_dynamic_plugins" - - def_threads='#define HAVE_THREADS 0' echocheck "pthread" @@ -6888,7 +6872,6 @@ cat > $TMPH << EOF #define MPLAYER_DATADIR "$_datadir" #define MPLAYER_CONFDIR "$_confdir" -#define MPLAYER_LIBDIR "$_libdir" #define MPLAYER_LOCALEDIR "$_localedir" $def_translation @@ -6973,7 +6956,6 @@ $def_unrar_exec $def_charset $def_crash_debug $def_debug -$def_dynamic_plugins $def_fastmemcpy $def_menu $def_runtime_cpudetection diff --git a/libmpcodecs/dec_audio.c b/libmpcodecs/dec_audio.c index 0541947f60..2445649075 100644 --- a/libmpcodecs/dec_audio.c +++ b/libmpcodecs/dec_audio.c @@ -37,10 +37,6 @@ #include "libaf/af.h" -#ifdef CONFIG_DYNAMIC_PLUGINS -#include <dlfcn.h> -#endif - #ifdef CONFIG_FAKE_MONO int fakemono = 0; #endif @@ -177,42 +173,6 @@ static int init_audio(sh_audio_t *sh_audio, char *codecname, char *afm, sh_audio->codec->drv)) break; mpadec = mpcodecs_ad_drivers[i]; -#ifdef CONFIG_DYNAMIC_PLUGINS - if (!mpadec) { - /* try to open shared decoder plugin */ - int buf_len; - char *buf; - ad_functions_t *funcs_sym; - ad_info_t *info_sym; - - buf_len = - strlen(MPLAYER_LIBDIR) + strlen(sh_audio->codec->drv) + 16; - buf = malloc(buf_len); - if (!buf) - break; - snprintf(buf, buf_len, "%s/mplayer/ad_%s.so", MPLAYER_LIBDIR, - sh_audio->codec->drv); - mp_msg(MSGT_DECAUDIO, MSGL_DBG2, - "Trying to open external plugin: %s\n", buf); - sh_audio->dec_handle = dlopen(buf, RTLD_LAZY); - if (!sh_audio->dec_handle) - break; - snprintf(buf, buf_len, "mpcodecs_ad_%s", sh_audio->codec->drv); - funcs_sym = dlsym(sh_audio->dec_handle, buf); - if (!funcs_sym || !funcs_sym->info || !funcs_sym->preinit - || !funcs_sym->init || !funcs_sym->uninit - || !funcs_sym->control || !funcs_sym->decode_audio) - break; - info_sym = funcs_sym->info; - if (strcmp(info_sym->short_name, sh_audio->codec->drv)) - break; - free(buf); - mpadec = funcs_sym; - mp_msg(MSGT_DECAUDIO, MSGL_V, - "Using external decoder plugin (%s/mplayer/ad_%s.so)!\n", - MPLAYER_LIBDIR, sh_audio->codec->drv); - } -#endif if (!mpadec) { // driver not available (==compiled in) mp_tmsg(MSGT_DECAUDIO, MSGL_ERR, "Requested audio codec family [%s] (afm=%s) not available.\nEnable it at compilation.\n", @@ -308,10 +268,6 @@ void uninit_audio(sh_audio_t *sh_audio) mp_tmsg(MSGT_DECAUDIO, MSGL_V, "Uninit audio: %s\n", sh_audio->codec->drv); sh_audio->ad_driver->uninit(sh_audio); -#ifdef CONFIG_DYNAMIC_PLUGINS - if (sh_audio->dec_handle) - dlclose(sh_audio->dec_handle); -#endif sh_audio->initialized = 0; } av_freep(&sh_audio->a_buffer); diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c index b41e4fb768..91b255114a 100644 --- a/libmpcodecs/dec_video.c +++ b/libmpcodecs/dec_video.c @@ -44,10 +44,6 @@ #include "dec_video.h" -#ifdef CONFIG_DYNAMIC_PLUGINS -#include <dlfcn.h> -#endif - // =================================================================== extern double video_time_usage; @@ -233,10 +229,6 @@ void uninit_video(sh_video_t *sh_video) return; mp_tmsg(MSGT_DECVIDEO, MSGL_V, "Uninit video: %s\n", sh_video->codec->drv); sh_video->vd_driver->uninit(sh_video); -#ifdef CONFIG_DYNAMIC_PLUGINS - if (sh_video->dec_handle) - dlclose(sh_video->dec_handle); -#endif vf_uninit_filter_chain(sh_video->vfilter); sh_video->initialized = 0; } @@ -296,42 +288,6 @@ static int init_video(sh_video_t *sh_video, char *codecname, char *vfm, sh_video->codec->drv)) break; sh_video->vd_driver = mpcodecs_vd_drivers[i]; -#ifdef CONFIG_DYNAMIC_PLUGINS - if (!sh_video->vd_driver) { - /* try to open shared decoder plugin */ - int buf_len; - char *buf; - vd_functions_t *funcs_sym; - vd_info_t *info_sym; - - buf_len = - strlen(MPLAYER_LIBDIR) + strlen(sh_video->codec->drv) + 16; - buf = malloc(buf_len); - if (!buf) - break; - snprintf(buf, buf_len, "%s/mplayer/vd_%s.so", MPLAYER_LIBDIR, - sh_video->codec->drv); - mp_msg(MSGT_DECVIDEO, MSGL_DBG2, - "Trying to open external plugin: %s\n", buf); - sh_video->dec_handle = dlopen(buf, RTLD_LAZY); - if (!sh_video->dec_handle) - break; - snprintf(buf, buf_len, "mpcodecs_vd_%s", sh_video->codec->drv); - funcs_sym = dlsym(sh_video->dec_handle, buf); - if (!funcs_sym || !funcs_sym->info || !funcs_sym->init - || !funcs_sym->uninit || !funcs_sym->control - || !funcs_sym->decode) - break; - info_sym = funcs_sym->info; - if (strcmp(info_sym->short_name, sh_video->codec->drv)) - break; - free(buf); - sh_video->vd_driver = funcs_sym; - mp_msg(MSGT_DECVIDEO, MSGL_V, - "Using external decoder plugin (%s/mplayer/vd_%s.so)!\n", - MPLAYER_LIBDIR, sh_video->codec->drv); - } -#endif if (!sh_video->vd_driver) { // driver not available (==compiled in) mp_tmsg(MSGT_DECVIDEO, MSGL_WARN, _("Requested video codec family [%s] (vfm=%s) not available.\nEnable it at compilation.\n"), diff --git a/libmpdemux/stheader.h b/libmpdemux/stheader.h index 80818e8785..06f52324e5 100644 --- a/libmpdemux/stheader.h +++ b/libmpdemux/stheader.h @@ -77,9 +77,6 @@ typedef struct sh_audio { int a_buffer_size; struct af_stream *afilter; // the audio filter stream const struct ad_functions *ad_driver; -#ifdef CONFIG_DYNAMIC_PLUGINS - void *dec_handle; -#endif // win32-compatible codec parameters: AVIStreamHeader audio; WAVEFORMATEX *wf; @@ -122,9 +119,6 @@ typedef struct sh_video { int output_flags; // query_format() results for output filters+vo const struct vd_functions *vd_driver; int vf_initialized; // -1 failed, 0 not done, 1 done -#ifdef CONFIG_DYNAMIC_PLUGINS - void *dec_handle; -#endif // win32-compatible codec parameters: AVIStreamHeader video; BITMAPINFOHEADER *bih; |