diff options
author | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2001-11-30 00:53:50 +0000 |
---|---|---|
committer | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2001-11-30 00:53:50 +0000 |
commit | 873578a7965683e3e76420731c1d571908b54848 (patch) | |
tree | cd8153e478f39f9aac7c851672996a8e58ace71e /src/demuxers/demux_mpgaudio.c | |
parent | ad5f52afbed82f29ba0816255edf1ff63533a2ff (diff) | |
download | xine-lib-873578a7965683e3e76420731c1d571908b54848.tar.gz xine-lib-873578a7965683e3e76420731c1d571908b54848.tar.bz2 |
Valid mrls are no more static (except few ones), like file suffix too.
First draft of compat.h (almost empty for now).
CVS patchset: 1139
CVS date: 2001/11/30 00:53:50
Diffstat (limited to 'src/demuxers/demux_mpgaudio.c')
-rw-r--r-- | src/demuxers/demux_mpgaudio.c | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index cc7acebad..7e0546358 100644 --- a/src/demuxers/demux_mpgaudio.c +++ b/src/demuxers/demux_mpgaudio.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: demux_mpgaudio.c,v 1.29 2001/11/18 03:53:23 guenter Exp $ + * $Id: demux_mpgaudio.c,v 1.30 2001/11/30 00:53:51 f1rmb Exp $ * * demultiplexer for mpeg audio (i.e. mp3) streams * @@ -36,18 +36,19 @@ #include "xine_internal.h" #include "xineutils.h" +#include "compat.h" #include "demux.h" -#ifndef __GNUC__ -#define __FUNCTION__ __func__ -#endif - #define DEMUX_MPGAUDIO_IFACE_VERSION 3 +#define VALID_ENDS "mp3,mp2,mpa,mpega" + typedef struct { demux_plugin_t demux_plugin; + config_values_t *config; + fifo_buffer_t *audio_fifo; fifo_buffer_t *video_fifo; @@ -372,7 +373,8 @@ static int demux_mpgaudio_open(demux_plugin_t *this_gen, case STAGE_BY_EXTENSION: { char *suffix; char *MRL; - + char *m, *valid_ends; + MRL = input->get_mrl (input); suffix = strrchr(MRL, '.'); @@ -380,12 +382,18 @@ static int demux_mpgaudio_open(demux_plugin_t *this_gen, if(!suffix) return DEMUX_CANNOT_HANDLE; - if(!strcasecmp(suffix, ".mp3") - || (!strcasecmp(suffix, ".mp2")) - || (!strcasecmp(suffix, ".mpa")) - || (!strcasecmp(suffix, ".mpega"))) { - this->input = input; - return DEMUX_CAN_HANDLE; + xine_strdupa(valid_ends, (this->config->register_string(this->config, + "mrl.ends_mgaudio", VALID_ENDS, + "valid mrls ending for mpeg audio demuxer", + NULL, NULL, NULL))); + while((m = xine_strsep(&valid_ends, ",")) != NULL) { + + while(*m == ' ' || *m == '\t') m++; + + if(!strcasecmp((suffix + 1), m)) { + this->input = input; + return DEMUX_CAN_HANDLE; + } } } break; @@ -430,7 +438,6 @@ static int demux_mpgaudio_get_stream_length (demux_plugin_t *this_gen) { demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { demux_mpgaudio_t *this; - config_values_t *config; if (iface != 6) { printf( "demux_mpeg: plugin doesn't support plugin API version %d.\n" @@ -440,8 +447,13 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { return NULL; } - this = malloc (sizeof (demux_mpgaudio_t)); - config = xine->config; + this = malloc (sizeof (demux_mpgaudio_t)); + this->config = xine->config; + + (void*) this->config->register_string(this->config, + "mrl.ends_mgaudio", VALID_ENDS, + "valid mrls ending for mpeg audio demuxer", + NULL, NULL, NULL); this->demux_plugin.interface_version = DEMUX_MPGAUDIO_IFACE_VERSION; this->demux_plugin.open = demux_mpgaudio_open; |