summaryrefslogtreecommitdiff
path: root/src/xine-engine/load_plugins.c
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2003-01-13 17:43:08 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2003-01-13 17:43:08 +0000
commit0f637614aca58c2eaf35231e682188a3177fe2b8 (patch)
treeecfdbde1ceb078ec1ee22e169dd1cffb9d835b6d /src/xine-engine/load_plugins.c
parentff6b3b711b74ff5f8b19ca453be261a19aa92177 (diff)
downloadxine-lib-0f637614aca58c2eaf35231e682188a3177fe2b8.tar.gz
xine-lib-0f637614aca58c2eaf35231e682188a3177fe2b8.tar.bz2
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 <section>.<plugin>.<entry> style (instead of the old <section>.<entry> 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
Diffstat (limited to 'src/xine-engine/load_plugins.c')
-rw-r--r--src/xine-engine/load_plugins.c28
1 files changed, 15 insertions, 13 deletions
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;