From 2e531aaf1427b2d3f6182047d7a396636e0d9fd5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 12 Jan 2015 05:14:41 +0100 Subject: vo: don't synchronize when seeking Don't use vo_control() for sending VOCTRL_RESET when starting a seek. This means vo_seek_reset() won't wait until the VO actually processed VOCTRL_RESET. It happens asynchronously instead. The impact of this change should be minimal, unless the VO is somehow too busy (like blocking on vsync). --- video/out/vo.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/video/out/vo.c b/video/out/vo.c index 2a0f17c748..0957f71813 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -130,6 +130,7 @@ struct vo_internal { bool hasframe_rendered; bool request_redraw; // redraw request from player to VO bool want_redraw; // redraw request from VO to player + bool send_reset; // send VOCTRL_RESET bool paused; int queued_events; @@ -697,7 +698,11 @@ static void *vo_thread(void *ptr) mp_input_wakeup(vo->input_ctx); } bool redraw = in->request_redraw; + bool send_reset = in->send_reset; + in->send_reset = false; pthread_mutex_unlock(&in->lock); + if (send_reset) + vo->driver->control(vo, VOCTRL_RESET, NULL); if (wait_until > now && redraw) { do_redraw(vo); // now is a good time continue; @@ -762,8 +767,9 @@ void vo_seek_reset(struct vo *vo) { pthread_mutex_lock(&vo->in->lock); forget_frames(vo); + vo->in->send_reset = true; + wakeup_locked(vo); pthread_mutex_unlock(&vo->in->lock); - vo_control(vo, VOCTRL_RESET, NULL); } // Return true if there is still a frame being displayed (or queued). -- cgit v1.2.3