summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-03 20:47:15 +0100
committerwm4 <wm4@nowhere>2015-11-03 20:47:15 +0100
commite187de7eedde0a38a0c7fa2b1c77bef6681de866 (patch)
tree79f0799af016b13c70a44748c83ce81019358c6c /video
parent49d94853b5cd5d8ab156dc551df0dd7d216f442f (diff)
downloadmpv-e187de7eedde0a38a0c7fa2b1c77bef6681de866.tar.bz2
mpv-e187de7eedde0a38a0c7fa2b1c77bef6681de866.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.c6
1 files changed, 3 insertions, 3 deletions
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) {