VirtualBox

Changeset 73524 in vbox for trunk/src


Ignore:
Timestamp:
Aug 6, 2018 12:28:13 PM (6 years ago)
Author:
vboxsync
Message:

Audio/DrvAudio: Don't use delta timing in drvAudioStreamGetWritable(), as this function can be called multiple times in a row within the same timing slot.

File:
1 edited

Legend:

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

    r73522 r73524  
    27992799    AssertMsg(pStream->enmDir == PDMAUDIODIR_OUT, ("Can't write to a non-output stream\n"));
    28002800
    2801     /* As the host side sets the overall pace, return the writable bytes from that side. */
    2802     const uint64_t deltaLastReadWriteNs = RTTimeNanoTS() - pStream->tsLastReadWrittenNs;
    2803 
    28042801    uint32_t cbWritable = 0;
    28052802
    28062803    if (DrvAudioHlpStreamStatusCanWrite(pStream->fStatus))
    28072804    {
    2808         cbWritable = DrvAudioHlpNanoToBytes(deltaLastReadWriteNs, &pStream->Host.Cfg.Props);
     2805        cbWritable = AudioMixBufFreeBytes(&pStream->Host.MixBuf);
    28092806
    28102807        /* Make sure to align the writable size to the guest's frame size. */
     
    28122809    }
    28132810
    2814     Log3Func(("[%s] cbWritable=%RU32 (%RU64ms)\n", pStream->szName, cbWritable, deltaLastReadWriteNs / RT_NS_1MS_64));
     2811    Log3Func(("[%s] cbWritable=%RU32 (%RU64ms2)\n",
     2812              pStream->szName, cbWritable, DrvAudioHlpBytesToMilli(cbWritable, &pStream->Host.Cfg.Props)));
    28152813
    28162814    rc2 = RTCritSectLeave(&pThis->CritSect);
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