Changeset 265


Ignore:
Timestamp:
04/15/07 23:39:12 (18 years ago)
Author:
r2d
Message:

sign issue in replay gain reading in sv7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpc/branches/r2d/libmpcdec/streaminfo.c

    r262 r265  
    123123        si->block_pwr          = 0;
    124124
     125// This is the gain reference used in old replaygain
     126#define OLD_GAIN_REF 65.
     127
    125128        // convert gain info
    126129        if (si->gain_title != 0) {
    127                 int tmp = (int)((65. - si->gain_title / 100.) * 256);
     130                int tmp = (int)((OLD_GAIN_REF - (mpc_int16_t)si->gain_title / 100.) * 256);
    128131                if (tmp >= (1 << 16) || tmp < 0) tmp = 0;
    129132                si->gain_title = (mpc_int16_t) tmp;
     
    131134
    132135        if (si->gain_album != 0) {
    133                 int tmp = (int)((65. - si->gain_album / 100.) * 256);
     136                int tmp = (int)((OLD_GAIN_REF - (mpc_int16_t)si->gain_album / 100.) * 256);
    134137                if (tmp >= (1 << 16) || tmp < 0) tmp = 0;
    135138                si->gain_album = (mpc_int16_t) tmp;
Note: See TracChangeset for help on using the changeset viewer.