VirtualBox

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


Ignore:
Timestamp:
Apr 27, 2015 12:59:47 PM (10 years ago)
Author:
vboxsync
Message:

Audio: Fixed unsigned sample conversion.

File:
1 edited

Legend:

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

    r55425 r55447  
    337337        if (_aSigned) \
    338338            return ((int64_t) aVal) << (32 - _aShift); \
    339         return ((int64_t) aVal - (_aMax >> 1)) << (32 - _aShift); \
     339        return ((int64_t) aVal - ((_aMax >> 1) + 1)) << (32 - _aShift); \
    340340    } \
    341341    \
     
    350350        if (_aSigned) \
    351351            return (_aType) (iVal >> (32 - _aShift)); \
    352         return ((_aType) ((iVal >> (32 - _aShift)) + (_aMax >> 1))); \
     352        return ((_aType) ((iVal >> (32 - _aShift)) + ((_aMax >> 1) + 1))); \
    353353    } \
    354354    \
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