VirtualBox

Changeset 73626 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 12, 2018 3:57:34 PM (6 years ago)
Author:
vboxsync
Message:

Audio/AC97: Made the stream's circular buffer size based on the current stream format (and not some random value).

File:
1 edited

Legend:

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

    r73625 r73626  
    945945
    946946    int rc = RTCritSectInit(&pStream->State.CritSect);
    947     if (RT_SUCCESS(rc))
    948         rc = RTCircBufCreate(&pStream->State.pCircBuf, _4K); /** @todo Make this configurable. */
    949947
    950948    pStream->Dbg.Runtime.fEnabled = pThis->Dbg.fEnabled;
     
    997995    LogFlowFunc(("[SD%RU8]\n", pStream->u8SD));
    998996
     997    ichac97R3StreamClose(pThis, pStream);
     998
    999999    int rc2 = RTCritSectDelete(&pStream->State.CritSect);
    10001000    AssertRC(rc2);
    1001 
    1002     if (pStream->State.pCircBuf)
    1003     {
    1004         RTCircBufDestroy(pStream->State.pCircBuf);
    1005         pStream->State.pCircBuf = NULL;
    1006     }
    10071001
    10081002# ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
     
    18621856            pCfg->Props.cShift    = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfg->Props.cBytes, pCfg->Props.cChannels);
    18631857
    1864             rc = ichac97R3MixerAddDrvStreams(pThis, pMixSink, pCfg);
     1858            rc = RTCircBufCreate(&pStream->State.pCircBuf, DrvAudioHlpMilliToBytes(100 /* ms */, &pCfg->Props)); /** @todo Make this configurable. */
     1859            if (RT_SUCCESS(rc))
     1860                rc = ichac97R3MixerAddDrvStreams(pThis, pMixSink, pCfg);
    18651861        }
    18661862    }
     
    18801876{
    18811877    RT_NOREF(pThis);
    1882     RT_NOREF(pStream);
    18831878
    18841879    LogFlowFunc(("[SD%RU8]\n", pStream->u8SD));
     1880
     1881    if (pStream->State.pCircBuf)
     1882    {
     1883        RTCircBufDestroy(pStream->State.pCircBuf);
     1884        pStream->State.pCircBuf = NULL;
     1885    }
    18851886
    18861887    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