mirror of https://github.com/mpv-player/mpv
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:
parent
c1a961ad78
commit
2446f5f43b
|
@ -1081,6 +1081,7 @@ static void *vo_thread(void *ptr)
|
||||||
mp_dispatch_queue_process(vo->in->dispatch, 0);
|
mp_dispatch_queue_process(vo->in->dispatch, 0);
|
||||||
if (in->terminate)
|
if (in->terminate)
|
||||||
break;
|
break;
|
||||||
|
stats_event(in->stats, "iterations");
|
||||||
vo->driver->control(vo, VOCTRL_CHECK_EVENTS, NULL);
|
vo->driver->control(vo, VOCTRL_CHECK_EVENTS, NULL);
|
||||||
bool working = render_frame(vo);
|
bool working = render_frame(vo);
|
||||||
int64_t now = mp_time_us();
|
int64_t now = mp_time_us();
|
||||||
|
@ -1096,10 +1097,10 @@ static void *vo_thread(void *ptr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (vo->want_redraw && !in->want_redraw) {
|
if (vo->want_redraw && !in->want_redraw) {
|
||||||
vo->want_redraw = false;
|
|
||||||
in->want_redraw = true;
|
in->want_redraw = true;
|
||||||
wakeup_core(vo);
|
wakeup_core(vo);
|
||||||
}
|
}
|
||||||
|
vo->want_redraw = false;
|
||||||
bool redraw = in->request_redraw;
|
bool redraw = in->request_redraw;
|
||||||
bool send_reset = in->send_reset;
|
bool send_reset = in->send_reset;
|
||||||
in->send_reset = false;
|
in->send_reset = false;
|
||||||
|
|
Loading…
Reference in New Issue