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. --- player/playloop.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'player') diff --git a/player/playloop.c b/player/playloop.c index 3dc185dd55..0c44042ab1 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -277,14 +277,13 @@ static void mp_seek(MPContext *mpctx, struct seek_params seek) hr_seek_very_exact = true; break; case MPSEEK_RELATIVE: - demux_flags = seek.amount > 0 ? SEEK_FORWARD : SEEK_BACKWARD; + demux_flags = seek.amount > 0 ? SEEK_FORWARD : 0; seek_pts = current_time + seek.amount; break; case MPSEEK_FACTOR: ; double len = get_time_length(mpctx); if (len >= 0) seek_pts = seek.amount * len; - demux_flags = SEEK_BACKWARD; break; default: abort(); } @@ -323,7 +322,7 @@ static void mp_seek(MPContext *mpctx, struct seek_params seek) hr_seek_offset = MPMAX(hr_seek_offset, -offset); } demux_pts -= hr_seek_offset; - demux_flags = (demux_flags | SEEK_HR | SEEK_BACKWARD) & ~SEEK_FORWARD; + demux_flags = (demux_flags | SEEK_HR) & ~SEEK_FORWARD; } demux_seek(mpctx->demuxer, demux_pts, demux_flags); -- cgit v1.2.3