From e187de7eedde0a38a0c7fa2b1c77bef6681de866 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 3 Nov 2015 20:47:15 +0100 Subject: vo: do not go to sleep if there's a new frame queued This affects only the display-sync code path, as for normal timing the wakeup_pts stuff handles proper wakeup. It's probably mostly a theoretical issue. --- video/out/vo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'video') diff --git a/video/out/vo.c b/video/out/vo.c index f1dfbd9441..46958e7f62 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -764,7 +764,7 @@ static bool render_frame(struct vo *vo) done: talloc_free(frame); pthread_mutex_unlock(&in->lock); - return got_frame; + return got_frame || (in->frame_queued && in->frame_queued->display_synced); } static void do_redraw(struct vo *vo) @@ -828,9 +828,9 @@ static void *vo_thread(void *ptr) if (in->terminate) break; vo->driver->control(vo, VOCTRL_CHECK_EVENTS, NULL); - bool frame_shown = render_frame(vo); + bool working = render_frame(vo); int64_t now = mp_time_us(); - int64_t wait_until = now + (frame_shown ? 0 : (int64_t)1e9); + int64_t wait_until = now + (working ? 0 : (int64_t)1e9); pthread_mutex_lock(&in->lock); if (in->wakeup_pts) { if (in->wakeup_pts > now) { -- cgit v1.2.3