diff options
author | wm4 <wm4@nowhere> | 2015-05-13 09:28:59 +0200 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-05-15 19:15:05 +0900 |
commit | 42fc0d96fc2ad994af38ac8451b64bc3ce0373e8 (patch) | |
tree | 41fb3be6a821cb9d1e6bf48e52473a2156a090df /video | |
parent | bbbedddddc8887a0cb7eb0ef334a9446e2e3a550 (diff) | |
download | mpv-42fc0d96fc2ad994af38ac8451b64bc3ce0373e8.tar.bz2 mpv-42fc0d96fc2ad994af38ac8451b64bc3ce0373e8.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.
(cherry picked from commit 0bdef9979f74db33d1c84ee788c45f5e1d8e0d0d)
Diffstat (limited to 'video')
-rw-r--r-- | video/out/vo.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/video/out/vo.c b/video/out/vo.c index 9f6e44a744..3e19006862 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -971,6 +971,8 @@ 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; pthread_mutex_unlock(&in->lock); |