From dbd22f43be49059c0ec801389103d5d16229bf26 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 23 Oct 2017 19:05:39 +0200 Subject: demux: drop redundant SEEK_BACKWARD flag Seems like most code dealing with this was for setting it in redundant cases. Now SEEK_BACKWARD is redundant, and SEEK_FORWARD is the odd one out. Also fix that SEEK_FORWARD was not correctly unset in try_seek_cache(). In demux_mkv_seek(), make the arbitrary decision that a video stream is not required for the subtitle prefetch logic to be active. We might want subtitles with long duration even with audio only playback, or if the file is used as external subtitle. --- demux/demux_lavf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'demux/demux_lavf.c') diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 53bf62016a..c11f7739e1 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -1014,7 +1014,7 @@ static void demux_seek_lavf(demuxer_t *demuxer, double seek_pts, int flags) int avsflags = 0; int64_t seek_pts_av = 0; - if (flags & SEEK_BACKWARD) + if (!(flags & SEEK_FORWARD)) avsflags = AVSEEK_FLAG_BACKWARD; if (flags & SEEK_FACTOR) { @@ -1031,7 +1031,7 @@ static void demux_seek_lavf(demuxer_t *demuxer, double seek_pts, int flags) seek_pts_av = seek_pts * priv->avfc->duration; } } else { - if (flags & SEEK_BACKWARD) + if (!(flags & SEEK_FORWARD)) seek_pts -= priv->seek_delay; seek_pts_av = seek_pts * AV_TIME_BASE; } -- cgit v1.2.3