VirtualBox

儲存庫 vbox 的更動 67501


忽略:
時間撮記:
2017-6-20 上午11:49:55 (7 年 以前)
作者:
vboxsync
訊息:

Audio/DrvAudio.cpp: Fixes for drvAudioStreamCaptureRaw().

檔案:
修改 1 筆資料

圖例:

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

    r67500 r67501  
    16781678    for (;;)
    16791679    {
    1680         uint32_t csReadable = pThis->pHostDrvAudio->pfnStreamGetReadable(pThis->pHostDrvAudio, pHstStream->pvBackend);
    1681         if (!csReadable)
     1680        uint32_t cbReadable = pThis->pHostDrvAudio->pfnStreamGetReadable(pThis->pHostDrvAudio, pHstStream->pvBackend);
     1681        if (!cbReadable) /* Nothing to read on the backend side? Bail out. */
    16821682            break;
    16831683
    1684         uint32_t csFree = AudioMixBufFree(&pHstStream->MixBuf);
    1685         if (!csFree)
     1684        const uint32_t cbFree = AudioMixBufFreeBytes(&pHstStream->MixBuf);
     1685        if (!cbFree) /* No space left in the host stream? */
    16861686            break;
    16871687
    1688         if (csFree < csReadable) /* More data captured than we can read? */
    1689         {
    1690             /** @todo Warn? */
    1691         }
     1688        if (cbReadable > cbFree) /* Don't capture more than the host stream currently can hold. */
     1689            cbReadable = cbFree;
    16921690
    16931691        PPDMAUDIOSAMPLE paSamples;
    16941692        uint32_t csWritable;
    1695         rc = AudioMixBufPeekMutable(&pHstStream->MixBuf, csReadable, &paSamples, &csWritable);
    1696         if (RT_FAILURE(rc))
     1693        rc = AudioMixBufPeekMutable(&pHstStream->MixBuf, AUDIOMIXBUF_B2S(&pHstStream->MixBuf, cbReadable),
     1694                                    &paSamples, &csWritable);
     1695        if (   RT_FAILURE(rc)
     1696            || !csWritable)
     1697        {
    16971698            break;
     1699        }
    16981700
    16991701        uint32_t csCaptured;
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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