summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-18 16:16:05 +0200
committerwm4 <wm4@nowhere>2014-07-18 16:16:05 +0200
commit1942e424e31df3e467522cca966429fd6c94429e (patch)
treedd43224a72d63135c42c31a15ee36ecff51fc58d /demux
parent2646874369b0c5beb2aa2d443734745a19ad4d6c (diff)
downloadmpv-1942e424e31df3e467522cca966429fd6c94429e.tar.bz2
mpv-1942e424e31df3e467522cca966429fd6c94429e.tar.xz
demux: fix opening pipes with demux_lavf
We told the demuxer that a pipe (if stream cache is enabled) is seekable. This is because the stream cache is technically seekable, it's just that seeking may fail at runtime if a non-cached byte range is requested. This caused libavformat to issue seeks on initialization (at least when piping mp4 youtube videos). Initialization failed completely after spamming tons of error messages. So, if an unseekable stream is cached, tell the demuxer that the file is not seekable. This gets reversed later (when printing a message about caching an unseekable stream), so the user can still try his luck by issuing a seek command. The important part is that libavformat initialization will not take code paths that will unnecessarily seek for whatever reasons. CC: @mpv-player/stable: regression from 0.3.x
Diffstat (limited to 'demux')
-rw-r--r--demux/demux.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 028fde324f..c7d27f7466 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -745,6 +745,11 @@ static struct demuxer *open_given_type(struct mpv_global *global,
.filename = talloc_strdup(demuxer, stream->url),
.events = DEMUX_EVENT_ALL,
};
+ demuxer->seekable = stream->seekable;
+ if (demuxer->stream->uncached_stream &&
+ !demuxer->stream->uncached_stream->seekable)
+ demuxer->seekable = false;
+
struct demux_internal *in = demuxer->in = talloc_ptrtype(demuxer, in);
*in = (struct demux_internal){
.log = demuxer->log,