mirror of
https://github.com/mpv-player/mpv
synced 2025-02-19 22:36:55 +00:00
player: deliver IDLE event after uninitializing state
A client API user might count on the fact that audio and video outputs have already been uninitialized. (They remain uninitialized before entering idle mode in order to allow smooth transition to the next playlist entry.) Since event delivery is asynchronous, this has to happen after actually doing the uninitialization, or the client will essentially run into a race condition.
This commit is contained in:
parent
895c8801a2
commit
147f4956d3
@ -1075,10 +1075,10 @@ void idle_loop(struct MPContext *mpctx)
|
||||
&& mpctx->stop_play != PT_QUIT)
|
||||
{
|
||||
if (need_reinit) {
|
||||
mp_notify(mpctx, MPV_EVENT_IDLE, NULL);
|
||||
uninit_audio_out(mpctx);
|
||||
handle_force_window(mpctx, true);
|
||||
mpctx->sleeptime = 0;
|
||||
mp_notify(mpctx, MPV_EVENT_IDLE, NULL);
|
||||
need_reinit = false;
|
||||
}
|
||||
mp_idle(mpctx);
|
||||
|
Loading…
Reference in New Issue
Block a user