diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-11-10 09:49:39 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-11-10 09:49:39 +0200 |
commit | 7b076f79a9ecec1ebd380cc753fb41e00d95483a (patch) | |
tree | 7512f5460bf0c7406d3a68040fbfa12399773f5d | |
parent | 8fb91511b1e69a0121d33ab48974e0a4b8151858 (diff) |
demux: error out if given invalid -demuxer option
The code choosing the demuxer to use only printed an error if given an
unknown demuxer name, then continued with default demuxer selection.
Change it to abort instead. This feels like more sensible behavior.
Also there's no fallback to autodetection in the case where the
demuxer name is recognized but the demuxer fails to open the file
either.
-rw-r--r-- | libmpdemux/demuxer.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index 32fc486e59..8c341e1920 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -1133,18 +1133,23 @@ demuxer_t *demux_open(struct MPOpts *opts, stream_t *vs, int file_format, get_demuxer_type_from_name(demuxer_name, &demuxer_force)) < 0) { mp_msg(MSGT_DEMUXER, MSGL_ERR, "-demuxer %s does not exist.\n", demuxer_name); + return NULL; } if ((audio_demuxer_type = get_demuxer_type_from_name(audio_demuxer_name, &audio_demuxer_force)) < 0) { mp_msg(MSGT_DEMUXER, MSGL_ERR, "-audio-demuxer %s does not exist.\n", audio_demuxer_name); + if (audio_stream) + return NULL; } if ((sub_demuxer_type = get_demuxer_type_from_name(sub_demuxer_name, &sub_demuxer_force)) < 0) { mp_msg(MSGT_DEMUXER, MSGL_ERR, "-sub-demuxer %s does not exist.\n", sub_demuxer_name); + if (sub_stream) + return NULL; } if (audio_stream) { |