VirtualBox

Changeset 88691 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Apr 23, 2021 7:57:31 PM (4 years ago)
Author:
vboxsync
Message:

DrvHostAudioDSound, DrvHostAudioWasApi: No need to call CoInitializeEx in the constructor as all EMTs do so when they're created (MTA). (For SMP VMs it wouldn't be enough it EMTs wasn't all initialized already.) bugref:9890

Location:
trunk/src/VBox/Devices/Audio
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevHdaStream.cpp

    r88690 r88691  
    25382538 *
    25392539 * This will do the heavy lifting work for us as soon as it's getting notified
    2540  * by another thread.}
     2540 * by the DMA timer callout.}
    25412541 */
    25422542static DECLCALLBACK(int) hdaR3StreamAsyncIOThread(RTTHREAD hThreadSelf, void *pvUser)
  • trunk/src/VBox/Devices/Audio/DrvHostAudioDSound.cpp

    r88573 r88691  
    26972697    PDMAudioHostEnumDelete(&pThis->DeviceEnum);
    26982698
    2699     if (pThis->pDrvIns)
    2700         CoUninitialize();
    2701 
    27022699    int rc2 = RTCritSectDelete(&pThis->CritSect);
    27032700    AssertRC(rc2);
     
    27832780     * Verify that IDirectSound is available.
    27842781     */
    2785     HRESULT hrc = CoInitializeEx(NULL, COINIT_MULTITHREADED);
     2782    LPDIRECTSOUND pDirectSound = NULL;
     2783    HRESULT hrc = CoCreateInstance(CLSID_DirectSound, NULL, CLSCTX_ALL, IID_IDirectSound, (void **)&pDirectSound);
    27862784    if (SUCCEEDED(hrc))
    2787     {
    2788         LPDIRECTSOUND pDirectSound = NULL;
    2789         hrc = CoCreateInstance(CLSID_DirectSound, NULL, CLSCTX_ALL, IID_IDirectSound, (void **)&pDirectSound);
    2790         if (SUCCEEDED(hrc))
    2791             IDirectSound_Release(pDirectSound);
    2792         else
    2793         {
    2794             LogRel(("DSound: DirectSound not available: %Rhrc\n", hrc));
    2795             return VERR_AUDIO_BACKEND_INIT_FAILED;
    2796         }
    2797     }
     2785        IDirectSound_Release(pDirectSound);
    27982786    else
    27992787    {
    2800         LogRel(("DSound: CoInitializeEx(,COINIT_MULTITHREADED) failed: %Rhrc\n", hrc));
     2788        LogRel(("DSound: DirectSound not available: %Rhrc\n", hrc));
    28012789        return VERR_AUDIO_BACKEND_INIT_FAILED;
    28022790    }
  • trunk/src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp

    r88672 r88691  
    22902290        uint32_t cRefs = pThis->pIEnumerator->Release(); RT_NOREF(cRefs);
    22912291        LogFlowFunc(("cRefs=%d\n", cRefs));
    2292         CoUninitialize();
    22932292    }
    22942293
     
    23672366     * as well as do enumeration thru.
    23682367     */
    2369     HRESULT hrc = CoInitializeEx(NULL, COINIT_MULTITHREADED);
    2370     AssertLogRelMsgReturn(SUCCEEDED(hrc), ("CoInitializeEx -> %Rhrc\n", hrc), VERR_AUDIO_BACKEND_INIT_FAILED);
    2371 
    2372     hrc = CoCreateInstance(__uuidof(MMDeviceEnumerator), 0, CLSCTX_ALL, __uuidof(IMMDeviceEnumerator),
    2373                            (void **)&pThis->pIEnumerator);
     2368    HRESULT hrc = CoCreateInstance(__uuidof(MMDeviceEnumerator), 0, CLSCTX_ALL, __uuidof(IMMDeviceEnumerator),
     2369                                   (void **)&pThis->pIEnumerator);
    23742370    if (FAILED(hrc))
    23752371    {
    23762372        pThis->pIEnumerator = NULL;
    2377         CoUninitialize(); /* uninitialize here so destructor can use pEnumeration as indicator. */
    23782373        LogRel(("WasAPI: Failed to create an MMDeviceEnumerator object: %Rhrc\n", hrc));
    23792374        return VERR_AUDIO_BACKEND_INIT_FAILED;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette