diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-02-14 00:35:29 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-02-14 00:35:29 +0000 |
commit | dd7b5d84dddb0454525832384f6d81ebbe98edf8 (patch) | |
tree | 2f3fbf82ef8070021f258cb332ab64e6b130d395 /src/xine-engine/xine.c | |
parent | 728634712f368899a599629aad9521b3ada874cf (diff) | |
download | xine-lib-dd7b5d84dddb0454525832384f6d81ebbe98edf8.tar.gz xine-lib-dd7b5d84dddb0454525832384f6d81ebbe98edf8.tar.bz2 |
introduce a new mrl key, example "stream.ext#lastdemuxprobe:demux_id"
- xine will try to open stream.ext using all demuxers _except_ demux_id.
- then it will be finally probed by content for demux_id.
why? this is the mechanism to catch buggy content probing demuxers.
it's is not intended for end users, but rather to make possible some
kind of script testing of xine-lib and QA before releases.
CVS patchset: 4149
CVS date: 2003/02/14 00:35:29
Diffstat (limited to 'src/xine-engine/xine.c')
-rw-r--r-- | src/xine-engine/xine.c | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 7028f8fa0..8ff6006f0 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.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: xine.c,v 1.229 2003/02/13 16:24:28 mroi Exp $ + * $Id: xine.c,v 1.230 2003/02/14 00:35:30 miguelfreitas Exp $ * * top-level xine functions * @@ -58,9 +58,9 @@ #include "xineutils.h" #include "compat.h" - +/* #define LOG - +*/ void xine_handle_stream_end (xine_stream_t *stream, int non_user) { @@ -567,6 +567,45 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) { } continue; } + if (strncasecmp(stream_setup, "lastdemuxprobe", 14) == 0) { + if (*(stream_setup += 14) == ':') { + /* all demuxers will be probed before the specified one */ + char *tmp = ++stream_setup; + char *demux_name; + stream_setup = strchr(stream_setup, ';'); + if (stream_setup) { + demux_name = (char *)malloc(stream_setup - tmp + 1); + memcpy(demux_name, tmp, stream_setup - tmp); + demux_name[stream_setup - tmp] = '\0'; + } else { + demux_name = (char *)malloc(strlen(tmp)); + memcpy(demux_name, tmp, strlen(tmp)); + demux_name[strlen(tmp)] = '\0'; + } + mrl_unescape(demux_name); + if (!(stream->demux_plugin = find_demux_plugin_last_probe(stream, demux_name, stream->input_plugin))) { + xine_log(stream->xine, XINE_LOG_MSG, + _("xine: last_probed demuxer %s failed to start\n"), demux_name); + stream->err = XINE_ERROR_NO_DEMUX_PLUGIN; + stream->status = XINE_STATUS_STOP; + free(demux_name); + return 0; + } +#ifdef LOG + printf ("xine: demux and input plugin found\n"); +#endif + + stream->meta_info[XINE_META_INFO_SYSTEMLAYER] + = strdup (stream->demux_plugin->demux_class->get_identifier(stream->demux_plugin->demux_class)); + free(demux_name); + } else { + printf("xine: error while parsing mrl\n"); + stream->err = XINE_ERROR_MALFORMED_MRL; + stream->status = XINE_STATUS_STOP; + return 0; + } + continue; + } if (strncasecmp(stream_setup, "novideo", 7) == 0) { stream_setup += 7; if (*stream_setup == ';' || *stream_setup == '\0') { |