diff options
Diffstat (limited to 'src/demuxers/demux_str.c')
-rw-r--r-- | src/demuxers/demux_str.c | 54 |
1 files changed, 16 insertions, 38 deletions
diff --git a/src/demuxers/demux_str.c b/src/demuxers/demux_str.c index 5591a0c6a..70c37a60c 100644 --- a/src/demuxers/demux_str.c +++ b/src/demuxers/demux_str.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2002 the xine project + * Copyright (C) 2000-2003 the xine project * * This file is part of xine, a free video player. * @@ -22,7 +22,7 @@ * This demuxer handles either raw STR files (which are just a concatenation * of raw compact disc sectors) or STR files with RIFF headers. * - * $Id: demux_str.c,v 1.8 2003/04/02 03:20:42 tmmm Exp $ + * $Id: demux_str.c,v 1.9 2003/04/17 19:01:30 miguelfreitas Exp $ */ /* CD-XA format: @@ -569,11 +569,6 @@ static int demux_str_get_optional_data(demux_plugin_t *this_gen, return DEMUX_OPTIONAL_UNSUPPORTED; } -static char *get_extensions (demux_class_t *this_gen) { - /* also .mov, but we don't want to hijack that extension */ - return "str iki ik2 dps dat xa xa1 xa2 xas xap"; -} - static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *stream, input_plugin_t *input_gen) { @@ -606,48 +601,26 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str switch (stream->content_detection_method) { - case METHOD_BY_CONTENT: - case METHOD_EXPLICIT: - - if (!open_str_file(this)) { - free (this); - return NULL; - } - break; - case METHOD_BY_EXTENSION: { - char *ending, *mrl, i, *extn; + char *extensions, *mrl; mrl = input->get_mrl (input); - - ending = strrchr(mrl, '.'); - - if (!ending) { - free(this); - return NULL; - } - - /* find if any of the extensions match */ - extn = get_extensions((demux_class_t *) this); - for (i = 0; *extn; extn++) { - if (*extn == ' ') { - if (ending[i+1] == '\0') break; - } - else { - if (*extn == ending[i+1]) i++; else i = 0; - } - } - if (ending[i+1] != '\0') { + extensions = class_gen->get_extensions (class_gen); + + if (!xine_demux_check_extension (mrl, extensions)) { free (this); return NULL; } + } + /* falling through is intended */ + + case METHOD_BY_CONTENT: + case METHOD_EXPLICIT: if (!open_str_file(this)) { free (this); return NULL; } - - } break; default: @@ -668,6 +641,11 @@ static char *get_identifier (demux_class_t *this_gen) { return "PSX STR"; } +static char *get_extensions (demux_class_t *this_gen) { + /* also .mov, but we don't want to hijack that extension */ + return "str iki ik2 dps dat xa xa1 xa2 xas xap"; +} + static char *get_mimetypes (demux_class_t *this_gen) { return NULL; } |