diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2004-12-22 22:05:22 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2004-12-22 22:05:22 +0000 |
commit | 585f2f2b82d5ad7e8599b7a0880e6f213e0fb3db (patch) | |
tree | 9a49562765cda4973c868023769aa47b18cc734a | |
parent | 1859eb0262e2eeef22aaea981797cb0e603927e1 (diff) | |
download | xine-lib-585f2f2b82d5ad7e8599b7a0880e6f213e0fb3db.tar.gz xine-lib-585f2f2b82d5ad7e8599b7a0880e6f213e0fb3db.tar.bz2 |
do not list plugins more than once
CVS patchset: 7296
CVS date: 2004/12/22 22:05:22
-rw-r--r-- | src/xine-engine/load_plugins.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 2e9c391eb..6fd2f4f6f 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.192 2004/12/20 21:38:25 mroi Exp $ + * $Id: load_plugins.c,v 1.193 2004/12/22 22:05:22 mroi Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -1256,8 +1256,9 @@ const char *const *xine_get_autoplay_input_plugin_ids(xine_t *this) { pthread_mutex_lock (&catalog->lock); catalog->ids[0] = NULL; - node = xine_list_first_content (catalog->input); - while (node) { + + for (node = xine_list_first_content (catalog->input); node; + node = xine_list_next_content (catalog->input)) { input_class_t *ic; ic = (input_class_t *) node->plugin_class; @@ -1266,12 +1267,14 @@ const char *const *xine_get_autoplay_input_plugin_ids(xine_t *this) { while (catalog->ids[i] && strcmp(catalog->ids[i], node->info->id) < 0) i++; + if (catalog->ids[i] && strcmp(catalog->ids[i], node->info->id) == 0) + /* do not list plugins twice */ + continue; for (j = PLUGIN_MAX - 1; j > i; j--) catalog->ids[j] = catalog->ids[j - 1]; catalog->ids[i] = node->info->id; } - node = xine_list_next_content (catalog->input); } pthread_mutex_unlock (&catalog->lock); @@ -1290,8 +1293,9 @@ const char *const *xine_get_browsable_input_plugin_ids(xine_t *this) { pthread_mutex_lock (&catalog->lock); catalog->ids[0] = NULL; - node = xine_list_first_content (catalog->input); - while (node) { + + for (node = xine_list_first_content (catalog->input); node; + node = xine_list_next_content (catalog->input)) { input_class_t *ic; ic = (input_class_t *) node->plugin_class; @@ -1300,12 +1304,14 @@ const char *const *xine_get_browsable_input_plugin_ids(xine_t *this) { while (catalog->ids[i] && strcmp(catalog->ids[i], node->info->id) < 0) i++; + if (catalog->ids[i] && strcmp(catalog->ids[i], node->info->id) == 0) + /* do not list plugins twice */ + continue; for (j = PLUGIN_MAX - 1; j > i; j--) catalog->ids[j] = catalog->ids[j - 1]; catalog->ids[i] = node->info->id; } - node = xine_list_next_content (catalog->input); } pthread_mutex_unlock (&catalog->lock); |