diff options
author | wm4 <wm4@nowhere> | 2019-11-06 21:34:52 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-11-06 21:35:32 +0100 |
commit | 48fc642e0c98025e12eafd388655da37848f94ef (patch) | |
tree | 5eef186afab89a9e556f8a9cf554104ef8f1ab55 /demux | |
parent | 517489814d6bc4837a1c24f7601a77136564fb7a (diff) | |
download | mpv-48fc642e0c98025e12eafd388655da37848f94ef.tar.bz2 mpv-48fc642e0c98025e12eafd388655da37848f94ef.tar.xz |
demux: unconditionally reposition stream to start before opening
The old code made it depend on ->seekable. If it isn't seekable, and
something discarded the data, then it'll just show an error message,
which will at least be somewhat informative. If no data was discarded,
the seek call is always a no-op.
There's a weird "timeline" condition in the old code; this doesn't
matter anymore, because timeline stuff does not pass streams down to
nested demuxers anymore.
Diffstat (limited to 'demux')
-rw-r--r-- | demux/demux.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/demux/demux.c b/demux/demux.c index e11db00ede..c6319281a0 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -3214,6 +3214,9 @@ static struct demuxer *open_given_type(struct mpv_global *global, mp_dbg(log, "Trying demuxer: %s (force-level: %s)\n", desc->name, d_level(check)); + if (stream) + stream_seek(stream, 0); + in->d_thread->params = params; // temporary during open() int ret = demuxer->desc->open(in->d_thread, check); if (ret >= 0) { @@ -3323,8 +3326,6 @@ static struct demuxer *demux_open(struct stream *stream, for (int n = 0; demuxer_list[n]; n++) { const struct demuxer_desc *desc = demuxer_list[n]; if (!check_desc || desc == check_desc) { - if (stream->seekable && (!params || !params->timeline)) - stream_seek(stream, 0); demuxer = open_given_type(global, log, desc, stream, &sinfo, params, level); if (demuxer) { |