VirtualBox

Ignore:
Timestamp:
Nov 6, 2015 12:26:32 PM (9 years ago)
Author:
vboxsync
Message:

Audio: Introduced reference counting for guest audio streams; this should prevent that the audio connector interface is destroying streams which still are being used by other parties, e.g. the audio mixer (bugref:8054).

File:
1 edited

Legend:

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

    r58170 r58600  
    23032303}
    23042304
    2305 static DECLCALLBACK(void) hdaCloseIn(PHDASTATE pThis, PDMAUDIORECSOURCE enmRecSource)
     2305static DECLCALLBACK(void) hdaDestroyIn(PHDASTATE pThis, PDMAUDIORECSOURCE enmRecSource)
    23062306{
    23072307    NOREF(pThis);
     
    23102310}
    23112311
    2312 static DECLCALLBACK(void) hdaCloseOut(PHDASTATE pThis)
     2312static DECLCALLBACK(void) hdaDestroyOut(PHDASTATE pThis)
    23132313{
    23142314    NOREF(pThis);
     
    23162316}
    23172317
    2318 static DECLCALLBACK(int) hdaOpenIn(PHDASTATE pThis,
    2319                                    const char *pszName, PDMAUDIORECSOURCE enmRecSource,
    2320                                    PPDMAUDIOSTREAMCFG pCfg)
     2318static DECLCALLBACK(int) hdaCreateIn(PHDASTATE pThis,
     2319                                     const char *pszName, PDMAUDIORECSOURCE enmRecSource,
     2320                                     PPDMAUDIOSTREAMCFG pCfg)
    23212321{
    23222322    PAUDMIXSINK pSink;
     
    23492349        }
    23502350
    2351         rc = pDrv->pConnector->pfnOpenIn(pDrv->pConnector, pszDesc, enmRecSource, pCfg, &pDrv->LineIn.pStrmIn);
    2352         LogFlowFunc(("LUN#%RU8: Opened input \"%s\", with rc=%Rrc\n", pDrv->uLUN, pszDesc, rc));
     2351        rc = pDrv->pConnector->pfnCreateIn(pDrv->pConnector, pszDesc, enmRecSource, pCfg, &pDrv->LineIn.pStrmIn);
     2352        LogFlowFunc(("LUN#%RU8: Created input \"%s\", with rc=%Rrc\n", pDrv->uLUN, pszDesc, rc));
    23532353        if (rc == VINF_SUCCESS) /* Note: Could return VWRN_ALREADY_EXISTS. */
    23542354        {
     
    23662366}
    23672367
    2368 static DECLCALLBACK(int) hdaOpenOut(PHDASTATE pThis,
    2369                                     const char *pszName, PPDMAUDIOSTREAMCFG pCfg)
     2368static DECLCALLBACK(int) hdaCreateOut(PHDASTATE pThis,
     2369                                      const char *pszName, PPDMAUDIOSTREAMCFG pCfg)
    23702370{
    23712371    int rc = VINF_SUCCESS;
     
    23812381        }
    23822382
    2383         rc = pDrv->pConnector->pfnOpenOut(pDrv->pConnector, pszDesc, pCfg, &pDrv->Out.pStrmOut);
    2384         LogFlowFunc(("LUN#%RU8: Opened output \"%s\", with rc=%Rrc\n", pDrv->uLUN, pszDesc, rc));
     2383        rc = pDrv->pConnector->pfnCreateOut(pDrv->pConnector, pszDesc, pCfg, &pDrv->Out.pStrmOut);
     2384        LogFlowFunc(("LUN#%RU8: Created output \"%s\", with rc=%Rrc\n", pDrv->uLUN, pszDesc, rc));
    23852385        if (rc == VINF_SUCCESS) /* Note: Could return VWRN_ALREADY_EXISTS. */
    23862386        {
     
    37613761
    37623762        /* Audio driver callbacks for multiplexing. */
    3763         pThis->pCodec->pfnCloseIn   = hdaCloseIn;
    3764         pThis->pCodec->pfnCloseOut  = hdaCloseOut;
    3765         pThis->pCodec->pfnOpenIn    = hdaOpenIn;
    3766         pThis->pCodec->pfnOpenOut   = hdaOpenOut;
    3767         pThis->pCodec->pfnReset     = hdaCodecReset;
    3768         pThis->pCodec->pfnSetVolume = hdaSetVolume;
     3763        pThis->pCodec->pfnDestroyIn  = hdaDestroyIn;
     3764        pThis->pCodec->pfnDestroyOut = hdaDestroyOut;
     3765        pThis->pCodec->pfnCreateIn   = hdaCreateIn;
     3766        pThis->pCodec->pfnCreateOut  = hdaCreateOut;
     3767        pThis->pCodec->pfnReset      = hdaCodecReset;
     3768        pThis->pCodec->pfnSetVolume  = hdaSetVolume;
    37693769
    37703770        pThis->pCodec->pHDAState = pThis; /* Assign HDA controller state to codec. */
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