VirtualBox

Changeset 74498 in vbox for trunk/src/VBox/Devices/Audio


Ignore:
Timestamp:
Sep 27, 2018 1:45:06 PM (6 years ago)
Author:
vboxsync
Message:

DrvAudio.cpp,pdmaudioifs.h: Added a HACK to avoid asserting in dsoundStreamReset when cleaning up after a failed stream creation attempt.

File:
1 edited

Legend:

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

    r74058 r74498  
    24362436        AssertPtr(pDrvAudioInst->pReg);
    24372437
     2438#if 0 /** @todo r=bird: Don't use strlen to check for empty strings.  Don't use RTStrPrintf to do RTStrCopy work. */
    24382439        char szDriver[64];
    24392440        RTStrPrintf(szDriver, RT_ELEMENTS(szDriver), "%s", pDrvAudioInst->pReg->szName);
     
    24462447        RTStrPrintf(pStream->szName, RT_ELEMENTS(pStream->szName), "[%s] %s",
    24472448                    szDriver, strlen(pCfgHost->szName) ? pCfgHost->szName : "<Untitled>");
     2449#else
     2450        Assert(pDrvAudioInst->pReg->szName[0] != '\0');
     2451        RTStrPrintf(pStream->szName, RT_ELEMENTS(pStream->szName), "[%s] %s",
     2452                    pDrvAudioInst->pReg->szName[0] != '\0' ? pDrvAudioInst->pReg->szName : "Untitled",
     2453                    pCfgHost->szName[0] != '\0' ? pCfgHost->szName : "<Untitled>");
     2454#endif
    24482455        pStream->enmDir = pCfgHost->enmDir;
    24492456
     
    30253032        return rc;
    30263033    }
     3034    pStream->fValidBackendData = true;
    30273035
    30283036    /* Validate acquired configuration. */
     
    30823090        /* Check if the pointer to  the host audio driver is still valid.
    30833091         * It can be NULL if we were called in drvAudioDestruct, for example. */
    3084         if (pThis->pHostDrvAudio)
     3092        if (pThis->pHostDrvAudio && pStream->fValidBackendData)
     3093        {
    30853094            rc = pThis->pHostDrvAudio->pfnStreamDestroy(pThis->pHostDrvAudio, pStream->pvBackend);
    3086 
     3095            pStream->fValidBackendData = false;
     3096        }
     3097
     3098        /** @todo r=bird: Who frees pvBackend? drvAudioStreamFree, right?
     3099         *        So, you cannot set to NULL here, can you? */
    30873100        pStream->pvBackend = NULL;
    30883101        pStream->cbBackend = 0;
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