VirtualBox

Changeset 73675 in vbox for trunk/src/VBox/Devices/Audio


Ignore:
Timestamp:
Aug 14, 2018 6:55:18 PM (6 years ago)
Author:
vboxsync
Message:

Audio/DrvAudio: Made sure that we don't do pre-buffer to the full buffer size by default, as this would lead to a buffer overflow too quickly. Instead, pre-buffer two full periods and also added a sanity check for this.

File:
1 edited

Legend:

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

    r73660 r73675  
    29612961    }
    29622962    else /* Set default pre-buffering size. */
    2963         pCfgReq->Backend.cfPreBuf = pCfgReq->Backend.cfBufferSize;
     2963        pCfgReq->Backend.cfPreBuf = pCfgReq->Backend.cfPeriod * 2;
    29642964
    29652965    LogRel2(("Audio: Using %s pre-buffering size (%RU64ms, %RU32 frames) for stream '%s'\n",
     
    29812981        && pCfgReq->Backend.cfPreBuf)
    29822982    {
    2983         if (pCfgReq->Backend.cfBufferSize < pCfgReq->Backend.cfPreBuf)
    2984         {
    2985             LogRel(("Audio: Error for stream '%s': Pre-buffering size (%RU64ms) must not be bigger than the buffer size (%RU64ms)\n",
     2983        if (pCfgReq->Backend.cfBufferSize <= pCfgReq->Backend.cfPreBuf)
     2984        {
     2985            LogRel(("Audio: Error for stream '%s': Buffering size (%RU64ms) must not be smaller as or equal to the pre-buffering size (%RU64ms)\n",
    29862986                    pStream->szName, DrvAudioHlpFramesToMilli(pCfgReq->Backend.cfPreBuf, &pCfgReq->Props),
    29872987                    DrvAudioHlpFramesToMilli(pCfgReq->Backend.cfBufferSize, &pCfgReq->Props)));
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