summaryrefslogtreecommitdiffstats
path: root/player
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 /player
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 'player')
-rw-r--r--player/playloop.c5
1 files changed, 2 insertions, 3 deletions
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);