VirtualBox

Changeset 73647 in vbox


Ignore:
Timestamp:
Aug 14, 2018 11:35:39 AM (6 years ago)
Author:
vboxsync
Message:

Audio/AC97: Don't destroy a stream's circular buffer on stream close, as there might be data in, which haven't been processed yet. Instead, destroy it when re-opening the stream and on stream destruction.

File:
1 edited

Legend:

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

    r73626 r73647  
    10161016    }
    10171017
     1018    if (pStream->State.pCircBuf)
     1019    {
     1020        RTCircBufDestroy(pStream->State.pCircBuf);
     1021        pStream->State.pCircBuf = NULL;
     1022    }
     1023
    10181024    LogFlowFuncLeave();
    10191025}
     
    18561862            pCfg->Props.cShift    = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfg->Props.cBytes, pCfg->Props.cChannels);
    18571863
    1858             rc = RTCircBufCreate(&pStream->State.pCircBuf, DrvAudioHlpMilliToBytes(100 /* ms */, &pCfg->Props)); /** @todo Make this configurable. */
     1864            if (pStream->State.pCircBuf)
     1865            {
     1866                RTCircBufDestroy(pStream->State.pCircBuf);
     1867                pStream->State.pCircBuf = NULL;
     1868            }
     1869
     1870            rc = RTCircBufCreate(&pStream->State.pCircBuf, DrvAudioHlpMilliToBytes(500 /* ms */, &pCfg->Props)); /** @todo Make this configurable. */
    18591871            if (RT_SUCCESS(rc))
    18601872                rc = ichac97R3MixerAddDrvStreams(pThis, pMixSink, pCfg);
     
    18781890
    18791891    LogFlowFunc(("[SD%RU8]\n", pStream->u8SD));
    1880 
    1881     if (pStream->State.pCircBuf)
    1882     {
    1883         RTCircBufDestroy(pStream->State.pCircBuf);
    1884         pStream->State.pCircBuf = NULL;
    1885     }
    18861892
    18871893    return VINF_SUCCESS;
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