VirtualBox

Changeset 76697 in vbox


Ignore:
Timestamp:
Jan 8, 2019 9:51:38 AM (6 years ago)
Author:
vboxsync
Message:

Audio/DrvAudio: Added a buffer underrun detection (also with optional release logging) for output streams.

File:
1 edited

Legend:

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

    r76686 r76697  
    14421442                  pStream->szName, tsDeltaPlayedCapturedNs, tsDeltaPlayedCapturedNs / RT_NS_1MS_64,
    14431443                  DrvAudioHlpFramesToMilli(cfLive, &pStream->Host.Cfg.Props), uLivePercent, pStream->fThresholdReached));
     1444
     1445        /* Has the treshold been reached (e.g. are we in playing stage) and we now have less live samples
     1446         * then time which has been passed? Then enter the buffering stage again. */
     1447        if (   pStream->fThresholdReached
     1448            && cfLive < cfPassedReal)
     1449        {
     1450            LogRel2(("Audio: Buffer underrun for stream '%s' occurred (%RU64ms passed but only %RU64ms in buffer)\n",
     1451                     pStream->szName,
     1452                     DrvAudioHlpFramesToMilli(cfPassedReal, &pStream->Host.Cfg.Props),
     1453                     DrvAudioHlpFramesToMilli(cfLive, &pStream->Host.Cfg.Props)));
     1454
     1455            /* Enter buffering stage again. */
     1456            pStream->fThresholdReached = false;
     1457        }
    14441458
    14451459        bool fDoPlay      = pStream->fThresholdReached;
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