Commit e4ff49d5 authored by Steven Noonan's avatar Steven Noonan

wasapi: ensure that wasapi context structure is zeroed before filling it

I had a situation where I was doing:

    ma_backend backends[] = {
	ma_backend_jack,
	ma_backend_wasapi,
    };
    ma_context_init(backends, sizeof(backends)/sizeof(backends[0]),
	&contextConfig, &context);

And since JACK was unavailable, it fell back to WASAPI. When this
happened, the WASAPI commandIndex and commandCount variables were
already stomped on by the JACK backend initialization, but the WASAPI
backend assumes they are zero-initialized.
Signed-off-by: default avatarSteven Noonan <steven@uplinklabs.net>
parent 0a7207d5
......@@ -16257,6 +16257,8 @@ static ma_result ma_context_init__wasapi(ma_context* pContext, const ma_context_
return result;
}
MA_ZERO_OBJECT(&pContext->wasapi);
/*
Annoyingly, WASAPI does not allow you to release an IAudioClient object from a different thread
than the one that retrieved it with GetService(). This can result in a deadlock in two
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment