From 0bdef9979f74db33d1c84ee788c45f5e1d8e0d0d Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 13 May 2015 09:28:59 +0200 Subject: vo: avoid burning CPU when paused Some code always calls vo_event(), even with event==0, which leads to immediate wakeup, which in turn causes the function to be called again. This would burn CPU, which was especially noticeable when paused. --- video/out/vo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'video/out') diff --git a/video/out/vo.c b/video/out/vo.c index 74b4fce42f..e670551994 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -982,9 +982,10 @@ void vo_event(struct vo *vo, int event) pthread_mutex_lock(&in->lock); if ((in->queued_events & event & VO_EVENTS_USER) != (event & VO_EVENTS_USER)) mp_input_wakeup(vo->input_ctx); + if (event) + wakeup_locked(vo); in->queued_events |= event; in->internal_events |= event; - wakeup_locked(vo); pthread_mutex_unlock(&in->lock); } -- cgit v1.2.3