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 | |
| 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')
| -rw-r--r-- | src/xine-engine/load_plugins.c | 21 | ||||
| -rw-r--r-- | src/xine-engine/xine.c | 11 |
2 files changed, 27 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, ';'); + } } } diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 9780052ca..39bef61d8 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -2278,6 +2278,9 @@ void xine_log (xine_t *this, int buf, const char *format, ...) { printf("%s", buffer); va_end (argp); } + + if (this->log_cb) + this->log_cb (this->log_cb_user_data, buf); } void xine_vlog(xine_t *this, int buf, const char *format, @@ -2286,6 +2289,9 @@ void xine_vlog(xine_t *this, int buf, const char *format, check_log_alloc (this, buf); this->log_buffers[buf]->scratch_printf(this->log_buffers[buf], format, args); + + if (this->log_cb) + this->log_cb (this->log_cb_user_data, buf); } char *const *xine_get_log (xine_t *this, int buf) { @@ -2299,6 +2305,11 @@ char *const *xine_get_log (xine_t *this, int buf) { return NULL; } +void xine_register_log_cb (xine_t *this, xine_log_cb_t cb, void *user_data) { + this->log_cb = cb; + this->log_cb_user_data = user_data; +} + int xine_get_error (xine_stream_t *stream) { return stream->err; } |
