summaryrefslogtreecommitdiffstats
path: root/demux/demux_lavf.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-01-27 04:39:10 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-01-26 23:29:42 -0800
commitef324e1316ca35236e065eae4535f9114bb83e5d (patch)
tree1bb124f828b67e5c505603e97969ddbcd4ff5746 /demux/demux_lavf.c
parent3766024dcd85ec7b3bffdcf81cf1356d6fc82543 (diff)
downloadmpv-ef324e1316ca35236e065eae4535f9114bb83e5d.tar.bz2
mpv-ef324e1316ca35236e065eae4535f9114bb83e5d.tar.xz
demux_lavf: export correct seekability state for HLS live streams
Requires newest FFmpeg git, which has a change that makes the HLS demuxer set an AVFMTCTX_UNSEEKABLE flag if seeking is not available, which is the case for HLS live streams. This should make the player frontend behave pretty well, instead of crapping up irrecoverably.
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r--demux/demux_lavf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 467569a42c..074c6edc7e 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -920,6 +920,11 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
demuxer->fully_read = priv->format_hack.fully_read;
+#ifdef AVFMTCTX_UNSEEKABLE
+ if (avfc->ctx_flags & AVFMTCTX_UNSEEKABLE)
+ demuxer->seekable = false;
+#endif
+
if (priv->avfc->duration > 0) {
demuxer->duration = (double)priv->avfc->duration / AV_TIME_BASE;
} else {