VirtualBox

儲存庫 vbox 的更動 62967


忽略:
時間撮記:
2016-8-4 上午10:18:22 (8 年 以前)
作者:
vboxsync
訊息:

Audio: 'cs' is not a prefix that anyone immediately understands to be count-of-samples, if anything they think critical section. So, please stop using it.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Devices/Audio/DrvHostNullAudio.cpp

    r62966 r62967  
    6464    PDMAUDIOSTREAM      Stream;
    6565    uint64_t            u64TicksLast;
    66     uint64_t            csPlayBuffer;
    67     uint8_t            *pu8PlayBuffer;
     66    uint64_t            cMaxSamplesInPlayBuffer;
     67    uint8_t            *pbPlayBuffer;
    6868} NULLAUDIOSTREAMOUT;
    6969typedef NULLAUDIOSTREAMOUT *PNULLAUDIOSTREAMOUT;
     
    152152        cSamplesPlayed = cLive;
    153153
    154     cSamplesPlayed = RT_MIN(cSamplesPlayed, pNullStream->csPlayBuffer);
    155 
    156     uint32_t csRead = 0;
    157     AudioMixBufReadCirc(&pStream->MixBuf, pNullStream->pu8PlayBuffer, AUDIOMIXBUF_S2B(&pStream->MixBuf, cSamplesPlayed), &csRead);
    158     AudioMixBufFinish(&pStream->MixBuf, csRead);
     154    cSamplesPlayed = RT_MIN(cSamplesPlayed, pNullStream->cMaxSamplesInPlayBuffer);
     155
     156    uint32_t cSamplesToRead = 0;
     157    AudioMixBufReadCirc(&pStream->MixBuf, pNullStream->pbPlayBuffer,
     158                        AUDIOMIXBUF_S2B(&pStream->MixBuf, cSamplesPlayed), &cSamplesToReadRead);
     159    AudioMixBufFinish(&pStream->MixBuf, cSamplesToRead);
    159160
    160161    if (pcSamplesPlayed)
    161         *pcSamplesPlayed = csRead;
     162        *pcSamplesPlayed = cSamplesToRead;
    162163
    163164    return VINF_SUCCESS;
     
    216217        PNULLAUDIOSTREAMOUT pNullStream = RT_FROM_MEMBER(pStream, NULLAUDIOSTREAMOUT, Stream);
    217218        pNullStream->u64TicksLast  = 0;
    218         pNullStream->csPlayBuffer = _1K;
    219         pNullStream->pu8PlayBuffer = (uint8_t *)RTMemAlloc(_1K << pStream->Props.cShift);
    220         if (pNullStream->pu8PlayBuffer)
     219        pNullStream->cMaxSamplesInPlayBuffer = _1K;
     220        pNullStream->pbPlayBuffer = (uint8_t *)RTMemAlloc(_1K << pStream->Props.cShift);
     221        if (pNullStream->pbPlayBuffer)
    221222        {
    222223            if (pcSamples)
    223                 *pcSamples = pNullStream->csPlayBuffer;
     224                *pcSamples = pNullStream->cMaxSamplesInPlayBuffer;
    224225        }
    225226        else
     
    264265    PNULLAUDIOSTREAMOUT pNullStream = RT_FROM_MEMBER(pStream, NULLAUDIOSTREAMOUT, Stream);
    265266    if (   pNullStream
    266         && pNullStream->pu8PlayBuffer)
     267        && pNullStream->pbPlayBuffer)
    267268    {
    268         RTMemFree(pNullStream->pu8PlayBuffer);
    269         pNullStream->pu8PlayBuffer = NULL;
     269        RTMemFree(pNullStream->pbPlayBuffer);
     270        pNullStream->pbPlayBuffer = NULL;
    270271    }
    271272
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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