Changeset 220 for libmpc/branches/r2d/libmpcdec
- Timestamp:
- 02/17/07 18:49:10 (18 years ago)
- Location:
- libmpc/branches/r2d/libmpcdec
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/branches/r2d/libmpcdec/mpc_demux.c
r219 r220 298 298 mpc_demux_fill(d, 11, 0); // max header block size 299 299 size = mpc_bits_get_block(&d->bits_reader, &b); 300 while( memcmp(b.key, "A D", 2) != 0 ){ // scan all blocks until audio300 while( memcmp(b.key, "AP", 2) != 0 ){ // scan all blocks until audio 301 301 mpc_demux_fill(d, 11 + (mpc_uint32_t) b.size, 0); 302 if (memcmp(b.key, "S I", 2) == 0){302 if (memcmp(b.key, "SH", 2) == 0){ 303 303 int ret = streaminfo_read_header_sv8(&d->si, &d->bits_reader, (mpc_uint32_t) b.size); 304 304 if (ret != MPC_STATUS_OK) return ret; 305 } else if (memcmp(b.key, "EI", 2) == 0) 305 } else if (memcmp(b.key, "RG", 2) == 0) 306 streaminfo_gain(&d->si, &d->bits_reader); 307 else if (memcmp(b.key, "EI", 2) == 0) 306 308 streaminfo_encoder_info(&d->si, &d->bits_reader); 307 else if (memcmp(b.key, "S P", 2) == 0)309 else if (memcmp(b.key, "SO", 2) == 0) 308 310 mpc_demux_SP(d, size, (mpc_uint32_t) b.size); 309 311 else if (memcmp(b.key, "ST", 2) == 0) … … 366 368 mpc_demux_fill(d, 11, 0); // max header block size 367 369 mpc_bits_get_block(&d->bits_reader, &b); 368 while( memcmp(b.key, "A D", 2) != 0 ) { // scan all blocks until audio370 while( memcmp(b.key, "AP", 2) != 0 ) { // scan all blocks until audio 369 371 if (memcmp(b.key, "SE", 2) == 0) { // end block 370 372 i->bits = -1; … … 436 438 size = mpc_bits_get_block(&d->bits_reader, &b); 437 439 while(i < fwd) { 438 if (memcmp(b.key, "A D", 2) == 0) {440 if (memcmp(b.key, "AP", 2) == 0) { 439 441 if (d->d->decoded_samples == (d->seek_table_size << d->seek_pwr) * MPC_FRAME_LENGTH) { 440 442 d->seek_table[d->seek_table_size] = (mpc_uint32_t) mpc_demux_pos(d) - 8 * size; -
libmpc/branches/r2d/libmpcdec/streaminfo.c
r219 r220 84 84 int major = si->encoder_version >> 24; 85 85 int minor = (si->encoder_version >> 16) & 0xFF; 86 int impl = (si->encoder_version >> 8) & 0xFF; 87 int build = si->encoder_version & 0xFF; 86 int build = (si->encoder_version >> 8) & 0xFF; 88 87 char * tmp = "--Stable--"; 89 88 … … 91 90 tmp = "--Unstable--"; 92 91 93 sprintf(si->encoder, "%s %u.%u.%u build %u", tmp, major, minor, impl, 94 build); 92 sprintf(si->encoder, "%s %u.%u build %u", tmp, major, minor, build); 95 93 } 96 94 } … … 164 162 mpc_bits_reader r = *r_in; 165 163 166 mpc_bits_read(&r, 8); // gain version 164 int version = mpc_bits_read(&r, 8); // gain version 165 if (version != 1) // we only know ver 1 166 return; 167 167 si->gain_title = (mpc_uint16_t) mpc_bits_read(&r, 16); 168 168 si->peak_title = (mpc_uint16_t) mpc_bits_read(&r, 16); … … 177 177 { 178 178 mpc_uint32_t CRC; 179 mpc_uint64_t info_len; 180 mpc_bits_reader r = *r_in, r_gain; 179 mpc_bits_reader r = *r_in; 181 180 182 181 CRC = mpc_bits_read(&r, 32); … … 184 183 return MPC_STATUS_FILE; 185 184 186 r_gain = r;187 mpc_bits_get_size(&r, &info_len);188 r_gain.buff += info_len;189 190 185 si->stream_version = mpc_bits_read(&r, 8); 191 186 if (si->stream_version != 8) … … 193 188 194 189 mpc_bits_get_size(&r, &si->samples); 190 mpc_bits_get_size(&r, &si->beg_silence); 191 mpc_bits_get_size(&r, &si->end_silence); 192 195 193 si->is_true_gapless = 1; 196 194 si->sample_freq = samplefreqs[mpc_bits_read(&r, 3)]; 195 si->max_band = mpc_bits_read(&r, 5) + 1; 197 196 si->channels = mpc_bits_read(&r, 4) + 1; 198 si->max_band = mpc_bits_read(&r, 5) + 1;199 197 si->ms = mpc_bits_read(&r, 1); 200 198 si->block_pwr = mpc_bits_read(&r, 3) * 2; … … 206 204 * si->sample_freq / si->samples; 207 205 208 streaminfo_gain(si, &r_gain);209 210 206 return MPC_STATUS_OK; 211 207 } … … 219 215 si->profile_name = mpc_get_version_string(si->profile); 220 216 si->pns = mpc_bits_read(&r, 1); 221 si->encoder_version = mpc_bits_read(&r, 4) << 24; // major217 si->encoder_version = mpc_bits_read(&r, 8) << 24; // major 222 218 si->encoder_version |= mpc_bits_read(&r, 8) << 16; // minor 223 si->encoder_version |= mpc_bits_read(&r, 4) << 8; // implementation224 si->encoder_version |= mpc_bits_read(&r, 8); // build 219 si->encoder_version |= mpc_bits_read(&r, 8) << 8; // build 220 225 221 226 222 mpc_get_encoder_string(si);
Note: See TracChangeset
for help on using the changeset viewer.