summaryrefslogtreecommitdiffstats
path: root/demux/demux_lavf.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-09-22 20:52:37 +0200
committerwm4 <wm4@nowhere>2019-09-22 20:52:37 +0200
commitcbff8a5862aaf715bc38c9f5d1b4e2bc43baaf2c (patch)
tree540cb98fc63edeaf29aaa8860a42c3cc1a62f282 /demux/demux_lavf.c
parent4a2f239842762dc11bb67a5cd54ab2b6f2fb4003 (diff)
downloadmpv-cbff8a5862aaf715bc38c9f5d1b4e2bc43baaf2c.tar.bz2
mpv-cbff8a5862aaf715bc38c9f5d1b4e2bc43baaf2c.tar.xz
demux_lavf: fix seeking in ogg audio streams
This detected the first packet demuxed after a seek as timestamp discontinuity. Obviously this is non-sense. Since the OGG radio streams for which this feature was introduced are normally unseekable, it's simple to fix this: simply disable it (if in auto mode, the default) as soon as a seek is performed. This code is never called if the stream is considered unseekable, unless the user forced it. There's still a chance this linearization is performed before a seek happens. This will be a bit awkward, but no worse than without this feature, since seeking with timestamp resets is inherently broken in both mpv and libavformat. Fixes: #6974 Fixes: 27fcd4d
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r--demux/demux_lavf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 1730d79716..1ccbd417de 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -1213,6 +1213,9 @@ static void demux_seek_lavf(demuxer_t *demuxer, double seek_pts, int flags)
"luck by enabling or enlarging the mpv cache.\n");
}
+ if (priv->linearize_ts < 0)
+ priv->linearize_ts = 0;
+
if (!(flags & SEEK_FORWARD))
avsflags = AVSEEK_FLAG_BACKWARD;