Changeset 347 for libmpc/trunk/libmpcdec/streaminfo.c
- Timestamp:
- 09/23/07 18:17:28 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/trunk/libmpcdec/streaminfo.c
r314 r347 127 127 128 128 // This is the gain reference used in old replaygain 129 #define OLD_GAIN_REF 6 5.129 #define OLD_GAIN_REF 64.82 130 130 131 131 // convert gain info 132 132 if (si->gain_title != 0) { 133 int tmp = (int)((OLD_GAIN_REF - (mpc_int16_t)si->gain_title / 100.) * 256);133 int tmp = OLD_GAIN_REF * 256 - ((int)(mpc_int16_t)si->gain_title * 256 + 50) / 100; 134 134 if (tmp >= (1 << 16) || tmp < 0) tmp = 0; 135 135 si->gain_title = (mpc_int16_t) tmp; … … 137 137 138 138 if (si->gain_album != 0) { 139 int tmp = (int)((OLD_GAIN_REF - (mpc_int16_t)si->gain_album / 100.) * 256);139 int tmp = OLD_GAIN_REF * 256 - ((int)(mpc_int16_t)si->gain_album * 256 + 50) / 100; 140 140 if (tmp >= (1 << 16) || tmp < 0) tmp = 0; 141 141 si->gain_album = (mpc_int16_t) tmp; … … 143 143 144 144 if (si->peak_title != 0) 145 si->peak_title = (mpc_uint16_t) (log10(si->peak_title) * 20 * 256 );145 si->peak_title = (mpc_uint16_t) (log10(si->peak_title) * 20 * 256 + .5); 146 146 147 147 if (si->peak_album != 0) 148 si->peak_album = (mpc_uint16_t) (log10(si->peak_album) * 20 * 256 );148 si->peak_album = (mpc_uint16_t) (log10(si->peak_album) * 20 * 256 + .5); 149 149 150 150 mpc_get_encoder_string(si);
Note: See TracChangeset
for help on using the changeset viewer.