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.
This commit is contained in:
wm4 2015-05-13 09:28:59 +02:00
parent fc9695e63b
commit 0bdef9979f
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}