From bfc1b44063ed6cfbc97da722803d6da90de0cf53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Thu, 18 Jan 2007 23:30:18 +0000 Subject: Handle strings coming from plugins as constants. CVS patchset: 8521 CVS date: 2007/01/18 23:30:18 --- src/xine-engine/load_plugins.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/xine-engine/load_plugins.c') diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 62f4705fa..25325aae1 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.228 2006/11/23 21:05:31 klan Exp $ + * $Id: load_plugins.c,v 1.229 2007/01/18 23:30:18 dgp85 Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -2375,14 +2375,14 @@ char *xine_get_file_extensions (xine_t *self) { list_size = xine_sarray_size (catalog->plugin_lists[PLUGIN_DEMUX - 1]); for (list_id = 0; list_id < list_size; list_id++) { demux_class_t *cls; - char *exts; + const char *exts; 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((exts = cls->get_extensions(cls)) && strlen(exts)) + if((exts = cls->get_extensions(cls)) && *exts) len += strlen(exts) + 1; } } @@ -2394,7 +2394,7 @@ char *xine_get_file_extensions (xine_t *self) { list_size = xine_sarray_size (catalog->plugin_lists[PLUGIN_DEMUX - 1]); for (list_id = 0; list_id < list_size; list_id++) { demux_class_t *cls; - char *e; + const char *e; int l; node = xine_sarray_get (catalog->plugin_lists[PLUGIN_DEMUX - 1], list_id); @@ -2402,7 +2402,7 @@ char *xine_get_file_extensions (xine_t *self) { cls = (demux_class_t *)node->plugin_class; - if((e = cls->get_extensions (cls)) && strlen(e)) { + if((e = cls->get_extensions (cls)) && *e) { l = strlen(e); memcpy (&str[pos], e, l); @@ -2444,7 +2444,7 @@ char *xine_get_mime_types (xine_t *self) { for (list_id = 0; list_id < list_size; list_id++) { demux_class_t *cls; - char *s; + const char *s; node = xine_sarray_get (catalog->plugin_lists[PLUGIN_DEMUX - 1], list_id); if (node->plugin_class || _load_plugin_class(self, node, NULL)) { @@ -2466,7 +2466,7 @@ char *xine_get_mime_types (xine_t *self) { for (list_id = 0; list_id < list_size; list_id++) { demux_class_t *cls; - char *s; + const char *s; int l; node = xine_sarray_get (catalog->plugin_lists[PLUGIN_DEMUX - 1], list_id); @@ -2503,6 +2503,7 @@ char *xine_get_demux_for_mime_type (xine_t *self, const char *mime_type) { char *id = NULL; char *mime_arg, *mime_demux; char *s; + const char *mt; int list_id, list_size; /* create a copy and convert to lower case */ @@ -2522,9 +2523,9 @@ char *xine_get_demux_for_mime_type (xine_t *self, const char *mime_type) { cls = (demux_class_t *)node->plugin_class; - s = cls->get_mimetypes (cls); - if (s) { - mime_demux = strdup(s); + mt = cls->get_mimetypes (cls); + if (mt) { + mime_demux = strdup(mt); for(s=mime_demux; *s; s++) *s = tolower(*s); -- cgit v1.2.3 From 8173333f753f6dbaeffc21fd9425825ab2b659fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Mon, 19 Feb 2007 23:33:33 +0000 Subject: Fix building with LOG enabled. CVS patchset: 8602 CVS date: 2007/02/19 23:33:33 --- src/xine-engine/load_plugins.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/xine-engine/load_plugins.c') diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 25325aae1..d35eba736 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.229 2007/01/18 23:30:18 dgp85 Exp $ + * $Id: load_plugins.c,v 1.230 2007/02/19 23:33:33 dgp85 Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -1989,18 +1989,19 @@ int _x_decoder_available (xine_t *xine, uint32_t buftype) return 0; } - #ifdef LOG static void _display_file_plugin_list (xine_list_t *list, plugin_file_t *file) { - plugin_node_t *node; + xine_list_iterator_t ite = xine_list_front(list); + + while (ite) { + plugin_node_t *node = xine_list_get_value(list, ite); - node = xine_list_first_content(list); - while (node) { if ((node->file == file) && (node->ref)) { printf(" plugin: %s, class: %p , %d instance(s)\n", node->info->id, node->plugin_class, node->ref); } - node = xine_list_next_content(list); + + ite = xine_list_next(list, ite); } } #endif -- cgit v1.2.3