mirror of https://github.com/mpv-player/mpv
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:
parent
fc9695e63b
commit
0bdef9979f
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue