Changeset 212 for libmpc/branches/r2d/libmpcdec/streaminfo.c
- Timestamp:
- 02/13/07 11:40:24 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/branches/r2d/libmpcdec/streaminfo.c
r201 r212 35 35 /// Implementation of streaminfo reading functions. 36 36 37 #include <math.h> 37 38 #include <mpc/mpcdec.h> 38 39 #include <mpc/streaminfo.h> … … 125 126 si->block_pwr = 0; 126 127 128 // convert gain info 129 if (si->gain_title != 0) { 130 int tmp = (int)((65. - si->gain_title / 100.) * 256); 131 if (tmp >= (1 << 16) || tmp < 0) tmp = 0; 132 si->gain_title = (mpc_int16_t) tmp; 133 } 134 135 if (si->gain_album != 0) { 136 int tmp = (int)((65. - si->gain_album / 100.) * 256); 137 if (tmp >= (1 << 16) || tmp < 0) tmp = 0; 138 si->gain_album = (mpc_int16_t) tmp; 139 } 140 141 if (si->peak_title != 0) 142 si->peak_title = (mpc_uint16_t) (__builtin_log10(si->peak_title) * 20 * 256); 143 144 if (si->peak_album != 0) 145 si->peak_album = (mpc_uint16_t) (__builtin_log10(si->peak_album) * 20 * 256); 146 127 147 mpc_get_encoder_string(si); 128 148 … … 146 166 147 167 mpc_bits_read(&r, 8); // gain version 148 // FIXME : add gain conversion149 168 si->gain_title = (mpc_uint16_t) mpc_bits_read(&r, 16); 150 169 si->peak_title = (mpc_uint16_t) mpc_bits_read(&r, 16);
Note: See TracChangeset
for help on using the changeset viewer.