path: root/player/video.c
diff options
authorwm4 <wm4@nowhere>2014-02-07 22:29:50 +0100
committerwm4 <wm4@nowhere>2014-02-07 22:29:50 +0100
commit17ec073a1588ddf768e64775ee51c0c47f94bfc2 (patch)
treeec243b24799ee28ffcf23dd2ca9997b8c6e69be2 /player/video.c
parent67769db1a4e3a765c5f770f44f8b2b041a0246a9 (diff)
player: handle seek delays differently
The code removed from handle_input_and_seek_coalesce() did two things: 1. If there's a queued seek, stop accepting non-seek commands, and delay them to the next playloop iteration. 2. If a seek is executing (i.e. the seek was unqueued, and now it's trying to decode and display the first video frame), stop accepting seek commands (and in fact all commands that were queued after the first seek command). This logic is disabled if seeking started longer than 300ms ago. (To avoid starvation.) I'm not sure why 1. would be needed. It's still possible that a command immediately executed after a seek command sees a "seeking in progress" state, because it affects queued seeks only, and not seeks in progress. Drop this code, since it can easily lead to input starvation, and I'm not aware of any disadvantages. The logic in 2. is good to make seeking behave much better, as it guarantees that the video display is updated frequently. Keep the core idea, but implement it differently. Now this logic is applied to seeks only. Commands after the seek can execute freely, and like with 1., I don't see a reason why they couldn't. However, in some cases, seeks are supposed to be executed instantly, so queue_seek() needs an additional parameter to signal the need for immediate update. One nice thing is that commands like sub_seek automatically profit from the seek delay logic. On the other hand, hitting chapter seek multiple times still does not update the video on chapter boundaries (as it should be). Note that the main goal of this commit is actually simplification of the input processing logic and to allow all commands to be executed immediately.
Diffstat (limited to 'player/video.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/player/video.c b/player/video.c
index 6f634270d2..9ca5e9e697 100644
--- a/player/video.c
+++ b/player/video.c
@@ -245,7 +245,7 @@ void mp_force_video_refresh(struct MPContext *mpctx)
// If not paused, the next frame should come soon enough.
if (opts->pause && mpctx->last_vo_pts != MP_NOPTS_VALUE)
- queue_seek(mpctx, MPSEEK_ABSOLUTE, mpctx->last_vo_pts, 1);
+ queue_seek(mpctx, MPSEEK_ABSOLUTE, mpctx->last_vo_pts, 1, true);
static bool filter_output_queued_frame(struct MPContext *mpctx)