summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-12 05:14:41 +0100
committerwm4 <wm4@nowhere>2015-01-12 05:14:41 +0100
commit2e531aaf1427b2d3f6182047d7a396636e0d9fd5 (patch)
tree24a635ad7dfd74a1f1477c0f499f07e2c9bbd8ce
parent3f3e1547ba6db29d626c0008f2e52bfd971327be (diff)
downloadmpv-2e531aaf1427b2d3f6182047d7a396636e0d9fd5.tar.bz2
mpv-2e531aaf1427b2d3f6182047d7a396636e0d9fd5.tar.xz
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).
-rw-r--r--video/out/vo.c8
1 files changed, 7 insertions, 1 deletions
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).