xine-lib/xine-lib-demuxcheckfor_mad_ffmpeg-LOCAL.diff

52 lines
1.7 KiB
Diff

From 8861e0d755127fde4b57d32561491853e49a0edc Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <lnussel@suse.de>
Date: Fri, 25 Jul 2008 15:07:23 +0200
Subject: [PATCH] xine-lib-demuxcheckfor_mad_ffmpeg-LOCAL.diff
===================================================================
---
src/xine-engine/load_plugins.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index a710927..e507c07 100644
--- a/src/xine-engine/load_plugins.c
+++ b/src/xine-engine/load_plugins.c
@@ -2481,9 +2481,18 @@ char *xine_get_file_extensions (xine_t *self) {
plugin_catalog_t *catalog = self->plugin_catalog;
int list_id;
+ int havempgdecoder = 0;
+ const char * const * p;
pthread_mutex_lock (&catalog->lock);
+ _build_list_typed_plugins(&catalog, catalog->plugin_lists[PLUGIN_AUDIO_DECODER - 1]);
+ for (p = catalog->ids; p && *p; p++) {
+ if (strcmp (*p, "mad") == 0 || strcmp (*p, "ffmpegaudio") == 0) {
+ havempgdecoder = 1;
+ break;
+ }
+ }
/* calc length of output string and create an array of strings to
concatenate */
size_t len = 0;
@@ -2495,7 +2504,13 @@ char *xine_get_file_extensions (xine_t *self) {
if (node->plugin_class || _load_plugin_class(self, node, NULL)) {
demux_class_t *const cls = (demux_class_t *)node->plugin_class;
if( (extensions[list_id] = cls->get_extensions(cls)) != NULL )
- len += strlen(extensions[list_id]) +1;
+ {
+ if(havempgdecoder || !strstr(extensions[list_id], "mp3")) {
+ len += strlen(extensions[list_id]) +1;
+ } else {
+ extensions[list_id] = NULL;
+ }
+ }
}
}
--
1.5.6