From 68fa754870eac5150ae6e96a1a5e18c1f07f63dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 19:21:21 +0100 Subject: Check if the extension is compatible with the plugin before trying to open it. --- src/xine-engine/load_plugins.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 717f81786..0a885f2d9 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -1298,6 +1298,12 @@ static demux_plugin_t *probe_demux (xine_stream_t *stream, int method1, int meth xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "load_plugins: probing demux '%s'\n", node->info->id); if (node->plugin_class || _load_plugin_class(stream->xine, node, NULL)) { + if ( stream->content_detection_method == METHOD_BY_EXTENSION && + ! _x_demux_check_extension(input->get_mrl(input), + ((demux_class_t *)node->plugin_class)->extensions) + ) + continue; + if ((plugin = ((demux_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) { inc_node_ref(node); plugin->node = node; @@ -1357,6 +1363,13 @@ demux_plugin_t *_x_find_demux_plugin_by_name(xine_stream_t *stream, const char * if (strcasecmp(node->info->id, name) == 0) { if (node->plugin_class || _load_plugin_class(stream->xine, node, NULL)) { + + if ( stream->content_detection_method == METHOD_BY_EXTENSION && + ! _x_demux_check_extension(input->get_mrl(input), + ((demux_class_t *)node->plugin_class)->extensions) + ) + continue; + if ((plugin = ((demux_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) { inc_node_ref(node); plugin->node = node; @@ -1414,6 +1427,14 @@ demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const cha xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "load_plugin: probing '%s' (method %d)...\n", node->info->id, stream->content_detection_method ); if (node->plugin_class || _load_plugin_class(xine, node, NULL)) { + + if ( stream->content_detection_method == METHOD_BY_EXTENSION && + ! _x_demux_check_extension(input->get_mrl(input), + ((demux_class_t *)node->plugin_class)->extensions) + ) + continue; + + if ((plugin = ((demux_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) { xprintf (stream->xine, XINE_VERBOSITY_DEBUG, "load_plugins: using demuxer '%s' (instead of '%s')\n", node->info->id, last_demux_name); -- cgit v1.2.3