diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/video_out/video_out_macosx.m | 15 | ||||
-rw-r--r-- | src/xine-engine/load_plugins.c | 11 | ||||
-rw-r--r-- | src/xine-engine/xine_plugin.h | 11 |
3 files changed, 18 insertions, 19 deletions
diff --git a/src/video_out/video_out_macosx.m b/src/video_out/video_out_macosx.m index 68a9de836..cb3dcc386 100644 --- a/src/video_out/video_out_macosx.m +++ b/src/video_out/video_out_macosx.m @@ -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: video_out_macosx.m,v 1.1 2004/06/05 16:06:13 jcdutton Exp $ + * $Id: video_out_macosx.m,v 1.2 2004/06/08 20:44:27 mroi Exp $ * * This output driver makes use of xine's objective-c video_output * classes located in the macosx folder. @@ -342,14 +342,9 @@ static vo_info_t vo_info_macosx = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_OUT, 19, "macosx", XINE_VERSION_CODE, &vo_info_macosx, init_class }, + /* work around the problem that dlclose() is not allowed to + * get rid of an image module which contains objective C code and simply + * crashes with a Trace/BPT trap when we try to do so */ + { PLUGIN_VIDEO_OUT | PLUGIN_NO_UNLOAD, 19, "macosx", XINE_VERSION_CODE, &vo_info_macosx, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; - -/* Dirty hack to get around the problem that dlclose() is not allowed to - * get rid of an image module which contains objective C code and simply - * crashes with a Trace/BPT trap when we try to do so. - * If this symbol if found in the library, dlclose() will be omitted. - */ -int plugin_contains_objc_code = 1; - diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index b7db9fc85..0a73283a7 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.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: load_plugins.c,v 1.177 2004/06/05 16:06:13 jcdutton Exp $ + * $Id: load_plugins.c,v 1.178 2004/06/08 20:44:27 mroi Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -511,6 +511,7 @@ static void collect_plugins(xine_t *this, char *path){ _("load_plugins: cannot open plugin lib %s:\n%s\n"), str, error); } else { + int do_not_unload = 0; if (info || (info = dlsym(lib, "xine_plugin_info"))) { @@ -569,6 +570,7 @@ static void collect_plugins(xine_t *this, char *path){ /* get next info either from lib or cache */ if( lib ) { info++; + do_not_unload = (do_not_unload || (info->type & PLUGIN_NO_UNLOAD)); } else { info = _get_cached_plugin ( this->plugin_catalog->cache, @@ -582,11 +584,8 @@ static void collect_plugins(xine_t *this, char *path){ xine_log (this, XINE_LOG_PLUGIN, _("load_plugins: can't get plugin info from %s:\n%s\n"), str, error); } - if( lib ) -#ifdef HOST_OS_DARWIN - if (dlsym (lib, "plugin_contains_objc_code") == NULL) -#endif - dlclose(lib); + if( lib && !do_not_unload ) + dlclose(lib); } break; case S_IFDIR: diff --git a/src/xine-engine/xine_plugin.h b/src/xine-engine/xine_plugin.h index 87662595f..5ed84c6c0 100644 --- a/src/xine-engine/xine_plugin.h +++ b/src/xine-engine/xine_plugin.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: xine_plugin.h,v 1.13 2004/05/16 17:58:16 tmattern Exp $ + * $Id: xine_plugin.h,v 1.14 2004/06/08 20:44:27 mroi Exp $ * * generic plugin definitions * @@ -39,9 +39,14 @@ /* this flag may be or'ed with type in order to force preloading the plugin. * very useful to register config items on xine initialization. */ -#define PLUGIN_MUST_PRELOAD 128 +#define PLUGIN_MUST_PRELOAD (1 << 7) -#define PLUGIN_TYPE_MASK 127 +/* this flag may be or'ed with type to prevent the plugin loader from unloading + * the plugin + */ +#define PLUGIN_NO_UNLOAD (1 << 8) + +#define PLUGIN_TYPE_MASK ((1 << 7) - 1) typedef struct { uint8_t type; /* one of the PLUGIN_* constants above */ |