1
mirror of https://github.com/mpv-player/mpv synced 2024-11-14 22:48:35 +01:00

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
This commit is contained in:
wm4 2019-09-22 20:52:37 +02:00
parent 4a2f239842
commit cbff8a5862

View File

@ -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;