From 0f637614aca58c2eaf35231e682188a3177fe2b8 Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Mon, 13 Jan 2003 17:43:08 +0000 Subject: autoscan plugins and config entries are ordered now good news for Daniel: no frontend change is required, the entries are sorted inside the engine I did not change the config entry names for now, because they seem well sorted already, so I avoided breaking everyones config file. But it is now possible to name the config keys in a
.. style (instead of the old
. style) resulting in entries of the same plugin being sorted next to each other. CVS patchset: 3901 CVS date: 2003/01/13 17:43:08 --- src/xine-engine/load_plugins.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 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 62083a13c..2f3034176 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.132 2003/01/11 21:22:20 mroi Exp $ + * $Id: load_plugins.c,v 1.133 2003/01/13 17:43:11 mroi Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -1088,30 +1088,31 @@ demux_plugin_t *find_demux_plugin_by_name(xine_stream_t *stream, const char *nam const char *const *xine_get_autoplay_input_plugin_ids(xine_t *this) { plugin_catalog_t *catalog; - int i; plugin_node_t *node; catalog = this->plugin_catalog; pthread_mutex_lock (&catalog->lock); - i = 0; + catalog->ids[0] = NULL; node = xine_list_first_content (catalog->input); while (node) { input_class_t *ic; ic = (input_class_t *) node->plugin_class; if (ic->get_autoplay_list) { + int i = 0, j; - catalog->ids[i] = node->info->id; + while (catalog->ids[i] && strcmp(catalog->ids[i], node->info->id) < 0) + i++; + for (j = PLUGIN_MAX - 1; j > i; j--) + catalog->ids[j] = catalog->ids[j - 1]; - i++; + catalog->ids[i] = node->info->id; } node = xine_list_next_content (catalog->input); } - catalog->ids[i] = NULL; - pthread_mutex_unlock (&catalog->lock); return catalog->ids; @@ -1121,30 +1122,31 @@ const char *const *xine_get_browsable_input_plugin_ids(xine_t *this) { plugin_catalog_t *catalog; - int i; plugin_node_t *node; catalog = this->plugin_catalog; pthread_mutex_lock (&catalog->lock); - i = 0; + catalog->ids[0] = NULL; node = xine_list_first_content (catalog->input); while (node) { input_class_t *ic; ic = (input_class_t *) node->plugin_class; if (ic->get_dir) { + int i = 0, j; - catalog->ids[i] = node->info->id; + while (catalog->ids[i] && strcmp(catalog->ids[i], node->info->id) < 0) + i++; + for (j = PLUGIN_MAX - 1; j > i; j--) + catalog->ids[j] = catalog->ids[j - 1]; - i++; + catalog->ids[i] = node->info->id; } node = xine_list_next_content (catalog->input); } - catalog->ids[i] = NULL; - pthread_mutex_unlock (&catalog->lock); return catalog->ids; -- cgit v1.2.3