summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-13 09:28:59 +0200
committerwm4 <wm4@nowhere>2015-05-13 09:28:59 +0200
commit0bdef9979f74db33d1c84ee788c45f5e1d8e0d0d (patch)
treee635d43699ed5d26358c570a91cf85a10849b685
parentfc9695e63b5baa1a478acb8e79c038571ee0e9b3 (diff)
downloadmpv-0bdef9979f74db33d1c84ee788c45f5e1d8e0d0d.tar.bz2
mpv-0bdef9979f74db33d1c84ee788c45f5e1d8e0d0d.tar.xz
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.
-rw-r--r--video/out/vo.c3
1 files changed, 2 insertions, 1 deletions
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);
}