-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[raudio] Fix crash when switching playback device #4102
Conversation
I put in two comments with what I did when I fixed this myself.
Like I said, I'm not sure if you need to do those extra things I did. Other then that it looks like the same thing I did to fix the crashes. |
@karl-zylinski As per MSDN (https://learn.microsoft.com/en-us/windows/desktop/api/combaseapi/nf-combaseapi-couninitialize):
You don't really have to store HRESULT as it should always be successful, meaning you should always call CoUninitialize. (It can't return RPC_E_CHANGED_MODE since we always pass a constant COINIT value). @raysan5 On my initial investigation of this issue (link) the only place that required modification is |
Thanks team, and sorry for my silence. When the device changes, WASAPI fires a callback from a separate thread. What I suspect is happening is that COM is not being initialized on that callback thread which is then resulting in this issue. If the COM initialization was moved to the |
@jkaup nice! thanks for the review! 👍😄 |
@mackron that's great! planning to update miniaudio library soon! 👍😄 |
Resolves #3743