Changeset 465 for libmpc/trunk/libmpcdec/mpc_demux.c
- Timestamp:
- 07/13/10 14:23:06 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/trunk/libmpcdec/mpc_demux.c
r463 r465 37 37 #include <mpc/streaminfo.h> 38 38 #include <mpc/mpcdec.h> 39 #include <mpc/minimax.h> 39 40 #include "internal.h" 40 41 #include "decoder.h" … … 360 361 size = mpc_bits_get_block(&d->bits_reader, &b); 361 362 while (memcmp(b.key, "CT", 2) == 0) { 363 int tmp_size; 364 char * tmp_ptag = ptag; 362 365 mpc_demux_fill(d, 11 + (mpc_uint32_t) b.size, 0); 363 366 size = mpc_bits_get_size(&d->bits_reader, &d->chap[i].sample) + 4; 364 367 d->chap[i].gain = (mpc_uint16_t) mpc_bits_read(&d->bits_reader, 16); 365 368 d->chap[i].peak = (mpc_uint16_t) mpc_bits_read(&d->bits_reader, 16); 366 memcpy(ptag, d->bits_reader.buff + ((8 - d->bits_reader.count) >> 3), b.size - size); 367 d->bits_reader.buff += b.size - size; 369 370 tmp_size = b.size - size; 371 do { 372 int rd_size = tmp_size; 373 mpc_uint8_t * tmp_buff = d->bits_reader.buff + ((8 - d->bits_reader.count) >> 3); 374 mpc_uint32_t avail_bytes = d->bytes_total + d->buffer - tmp_buff; 375 rd_size = mini(rd_size, avail_bytes); 376 memcpy(tmp_ptag, tmp_buff, rd_size); 377 tmp_size -= rd_size; 378 tmp_ptag += rd_size; 379 d->bits_reader.buff += rd_size; 380 mpc_demux_fill(d, tmp_size, 0); 381 } while (tmp_size > 0); 382 368 383 d->chap[i].tag_size = b.size - size; 369 384 d->chap[i].tag = ptag;
Note: See TracChangeset
for help on using the changeset viewer.