mirror of
https://github.com/mpv-player/mpv
synced 2025-01-29 19:22:48 +00:00
ao/wasapi: fix race condition in uninit on failure.
When the audio thread fails to properly init, it signals failure to the main thread, AND THEN starts to clean up. For this to work, ao_init callback must not return until the thread's cleanup is finished. This is correctly handled in the ao_uninit callback by waiting for the thread to exit, so just call that to clean up the main thread. I have no idea why I didn't do this in the first place.
This commit is contained in:
parent
d9bac96a9d
commit
ebd161b256
@ -230,8 +230,7 @@ static int init(struct ao *ao)
|
||||
if (state->init_ret != S_OK) {
|
||||
if (!ao->probing)
|
||||
MP_ERR(ao, "Received failure from audio thread\n");
|
||||
if (state->VistaBlob.hAvrt)
|
||||
FreeLibrary(state->VistaBlob.hAvrt);
|
||||
uninit(ao);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user