Ignore:
Timestamp:
09/23/07 19:20:36 (17 years ago)
Author:
r2d
Message:

replay gain changes again ... last change was not correct

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpc/trunk/libmpcdec/streaminfo.c

    r347 r350  
    131131        // convert gain info
    132132        if (si->gain_title != 0) {
    133                 int tmp = OLD_GAIN_REF * 256 - ((int)(mpc_int16_t)si->gain_title * 256 + 50) / 100;
     133                int tmp = (int)((OLD_GAIN_REF - (mpc_int16_t)si->gain_title / 100.) * 256. + .5);
    134134                if (tmp >= (1 << 16) || tmp < 0) tmp = 0;
    135135                si->gain_title = (mpc_int16_t) tmp;
     
    137137
    138138        if (si->gain_album != 0) {
    139                 int tmp = OLD_GAIN_REF * 256 - ((int)(mpc_int16_t)si->gain_album * 256 + 50) / 100;
     139                int tmp = (int)((OLD_GAIN_REF - (mpc_int16_t)si->gain_album / 100.) * 256. + .5);
    140140                if (tmp >= (1 << 16) || tmp < 0) tmp = 0;
    141141                si->gain_album = (mpc_int16_t) tmp;
Note: See TracChangeset for help on using the changeset viewer.