From 48fc642e0c98025e12eafd388655da37848f94ef Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 6 Nov 2019 21:34:52 +0100 Subject: 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. --- demux/demux.c | 5 +++-- 1 file 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) { -- cgit v1.2.3