VirtualBox

Changeset 54420 in vbox


Ignore:
Timestamp:
Feb 24, 2015 8:22:47 AM (10 years ago)
Author:
vboxsync
Message:

Audio/AudioMixBuffer: all of these values are unsigned so no need to compare against 0

File:
1 edited

Legend:

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

    r54399 r54420  
    9999    pMixBuf->offReadWrite = (pMixBuf->offReadWrite + cSamplesRead) % pMixBuf->cSamples;
    100100    Assert(pMixBuf->offReadWrite <= pMixBuf->cSamples);
    101     pMixBuf->cProcessed -= RT_CLAMP(cSamplesRead, 0, pMixBuf->cProcessed);
     101    pMixBuf->cProcessed -= RT_MIN(cSamplesRead, pMixBuf->cProcessed);
    102102
    103103    *pcSamplesRead = cSamplesRead;
     
    10321032    {
    10331033        pMixBuf->offReadWrite = offRead % pMixBuf->cSamples;
    1034         pMixBuf->cProcessed -= RT_CLAMP(cLenSrc1 + cLenSrc2, 0, pMixBuf->cProcessed);
     1034        pMixBuf->cProcessed -= RT_MIN(cLenSrc1 + cLenSrc2, pMixBuf->cProcessed);
    10351035
    10361036        if (pcRead)
     
    12961296    {
    12971297        pMixBuf->offReadWrite = offWrite % pMixBuf->cSamples;
    1298         pMixBuf->cProcessed = RT_CLAMP(pMixBuf->cProcessed + cLenDst1 + cLenDst2,
    1299                                        0 /* Min */, pMixBuf->cSamples /* Max */);
     1298        pMixBuf->cProcessed = RT_MIN(pMixBuf->cProcessed + cLenDst1 + cLenDst2,
     1299                                     pMixBuf->cSamples /* Max */);
    13001300        if (pcWritten)
    13011301            *pcWritten = cLenDst1 + cLenDst2;
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