0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02: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:
Kevin Mitchell 2014-11-17 23:30:49 -08:00
parent d9bac96a9d
commit ebd161b256

View File

@ -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;
}