VirtualBox

Changeset 67498 in vbox for trunk/src


Ignore:
Timestamp:
Jun 20, 2017 11:26:45 AM (8 years ago)
Author:
vboxsync
Message:

Audio/DrvAudio.cpp: Do not attempt to write more than available in drvAudioStreamWrite().

File:
1 edited

Legend:

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

    r67469 r67498  
    940940                   pGstStream->szName, pszGstSts, pszHstSts));
    941941#endif
    942         pGstStream->Out.tsLastWriteMS = RTTimeMilliTS();
    943 
    944         if (!AudioMixBufFreeBytes(&pGstStream->MixBuf))
    945         {
    946             LogRel2(("Audio: Guest stream '%s' full, expect stuttering audio output\n", pGstStream->szName));
    947 
    948 #ifdef DEBUG_andy
    949             AssertMsgFailed(("[%s] Failed because guest stream full (guest status %s, host status %s): cbBuf=%RU32\n",
    950                              pGstStream->szName, pszGstSts, pszHstSts, cbBuf));
    951 #endif
    952             break;
    953         }
     942        const uint32_t cbFree = AudioMixBufFreeBytes(&pGstStream->MixBuf);
     943        if (!cbFree) /* No free guest side buffer space, bail out. */
     944            break;
     945
     946        /* Do not attempt to write more than the guest side currently can handle. */
     947        if (cbBuf > cbFree)
     948            cbBuf = cbFree;
    954949
    955950        uint32_t csWritten = 0;
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