summaryrefslogtreecommitdiffstats
path: root/demux/demux_lavf.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-10-23 19:05:39 +0200
committerwm4 <wm4@nowhere>2017-10-23 19:05:39 +0200
commitdbd22f43be49059c0ec801389103d5d16229bf26 (patch)
tree078acbfe7af703120b5e38a6bad285c4182dceec /demux/demux_lavf.c
parent26b46950a101612073d83e782fbe3c1a5fd03aca (diff)
downloadmpv-dbd22f43be49059c0ec801389103d5d16229bf26.tar.bz2
mpv-dbd22f43be49059c0ec801389103d5d16229bf26.tar.xz
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.
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r--demux/demux_lavf.c4
1 files changed, 2 insertions, 2 deletions
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;
}