diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-06-11 19:32:28 +0100 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-06-11 19:32:28 +0100 |
commit | 3b80ae534dbba2eb355d1ede99e92b5431a7e3aa (patch) | |
tree | df24f97f7153a415afd5af101f45eded25e08967 /src/xine-engine/load_plugins.c | |
parent | 8f1264ac2d3cb3e81f3ce64973b150fc82681286 (diff) | |
parent | acc0fe7a56ffdfa0ca359ba4a18fe7381933dbc5 (diff) | |
download | xine-lib-3b80ae534dbba2eb355d1ede99e92b5431a7e3aa.tar.gz xine-lib-3b80ae534dbba2eb355d1ede99e92b5431a7e3aa.tar.bz2 |
Merge from 1.1.
--HG--
rename : src/xine-engine/xine_internal.h => include/xine/xine_internal.h
Diffstat (limited to 'src/xine-engine/load_plugins.c')
-rw-r--r-- | src/xine-engine/load_plugins.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 39d97f521..050a01832 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -2664,21 +2664,32 @@ char *xine_get_demux_for_mime_type (xine_t *self, const char *mime_type) { plugin_node_t *node; char *id = NULL; int list_id, list_size; + const size_t mime_type_len = strlen (mime_type); pthread_mutex_lock (&catalog->lock); list_size = xine_sarray_size (catalog->plugin_lists[PLUGIN_DEMUX - 1]); for (list_id = 0; (list_id < list_size) && !id; list_id++) { - demux_class_t *cls; node = xine_sarray_get (catalog->plugin_lists[PLUGIN_DEMUX - 1], list_id); if (node->plugin_class || _load_plugin_class(self, node, NULL)) { - cls = (demux_class_t *)node->plugin_class; - - if (cls->mimetypes && strcasestr(cls->mimetypes, mime_type) ) - id = strdup(node->info->id); + demux_class_t *cls = (demux_class_t *)node->plugin_class; + const char *mime = cls->mimetypes; + while (mime) + { + while (*mime == ';' || isspace (*mime)) + ++mime; + if (!strncmp (mime, mime_type, mime_type_len) && + (!mime[mime_type_len] || mime[mime_type_len] == ':' || mime[mime_type_len] == ';')) + { + free (id); + id = strdup(node->info->id); + break; + } + mime = strchr (mime, ';'); + } } } |