From cbff8a5862aaf715bc38c9f5d1b4e2bc43baaf2c Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 22 Sep 2019 20:52:37 +0200 Subject: 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 --- demux/demux_lavf.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'demux') 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; -- cgit v1.2.3