mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-02 05:17:31 +09:00
Fix runtime error in libcubeb
This commit is contained in:
parent
5ffe72cab3
commit
99a1d556de
1 changed files with 12 additions and 0 deletions
|
|
@ -938,6 +938,12 @@ BOOL WINAPI revert_mm_thread_characteristics_noop(HANDLE mmcss_handle)
|
||||||
|
|
||||||
HRESULT register_notification_client(cubeb_stream * stm)
|
HRESULT register_notification_client(cubeb_stream * stm)
|
||||||
{
|
{
|
||||||
|
#if defined(__MINGW32__)
|
||||||
|
// MinGW builds have shown crashes in MMDevApi callback dispatch paths.
|
||||||
|
// Skip notification registration and rely on normal stream operation.
|
||||||
|
(void)stm;
|
||||||
|
return S_OK;
|
||||||
|
#else
|
||||||
HRESULT hr = CoCreateInstance(__uuidof(MMDeviceEnumerator),
|
HRESULT hr = CoCreateInstance(__uuidof(MMDeviceEnumerator),
|
||||||
NULL, CLSCTX_INPROC_SERVER,
|
NULL, CLSCTX_INPROC_SERVER,
|
||||||
IID_PPV_ARGS(&stm->device_enumerator));
|
IID_PPV_ARGS(&stm->device_enumerator));
|
||||||
|
|
@ -958,10 +964,15 @@ HRESULT register_notification_client(cubeb_stream * stm)
|
||||||
}
|
}
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT unregister_notification_client(cubeb_stream * stm)
|
HRESULT unregister_notification_client(cubeb_stream * stm)
|
||||||
{
|
{
|
||||||
|
#if defined(__MINGW32__)
|
||||||
|
(void)stm;
|
||||||
|
return S_OK;
|
||||||
|
#else
|
||||||
XASSERT(stm);
|
XASSERT(stm);
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
|
|
@ -981,6 +992,7 @@ HRESULT unregister_notification_client(cubeb_stream * stm)
|
||||||
SafeRelease(stm->device_enumerator);
|
SafeRelease(stm->device_enumerator);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT get_endpoint(IMMDevice ** device, LPCWSTR devid)
|
HRESULT get_endpoint(IMMDevice ** device, LPCWSTR devid)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue