1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 10:02:17 +00:00

vo: always reset redraw flag to avoid immediate wakeups wasting CPU time

This could temporarily hog the core or something because it's a stupid
fragile state machine that should best be wiped out.

Fixes: #7699
This commit is contained in:
wm4 2020-05-09 22:11:34 +02:00
parent c1a961ad78
commit 2446f5f43b

View File

@ -1081,6 +1081,7 @@ static void *vo_thread(void *ptr)
mp_dispatch_queue_process(vo->in->dispatch, 0);
if (in->terminate)
break;
stats_event(in->stats, "iterations");
vo->driver->control(vo, VOCTRL_CHECK_EVENTS, NULL);
bool working = render_frame(vo);
int64_t now = mp_time_us();
@ -1096,10 +1097,10 @@ static void *vo_thread(void *ptr)
}
}
if (vo->want_redraw && !in->want_redraw) {
vo->want_redraw = false;
in->want_redraw = true;
wakeup_core(vo);
}
vo->want_redraw = false;
bool redraw = in->request_redraw;
bool send_reset = in->send_reset;
in->send_reset = false;