Changeset 337 for libmpc/trunk/libmpcdec
- Timestamp:
- 06/27/07 20:00:25 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/trunk/libmpcdec/mpc_demux.c
r314 r337 70 70 mpc_uint32_t unread_bytes = d->bytes_total + d->buffer - d->bits_reader.buff 71 71 - ((8 - d->bits_reader.count) >> 3); 72 int offset = 0; 72 73 73 74 if (min_bytes == 0 || min_bytes > DEMUX_BUFFER_SIZE || … … 79 80 mpc_uint32_t bytes_free = DEMUX_BUFFER_SIZE - d->bytes_total; 80 81 81 if (flags & MPC_BUFFER_SWAP) 82 if (flags & MPC_BUFFER_SWAP) { 82 83 bytes2read &= -1 << 2; 84 offset = (unread_bytes + 3) & ( -1 << 2); 85 offset -= unread_bytes; 86 } 83 87 84 88 if (bytes2read > bytes_free) { … … 87 91 d->bits_reader.buff++; 88 92 } 89 memmove(d->buffer , d->bits_reader.buff, unread_bytes);90 d->bits_reader.buff = d->buffer ;91 d->bytes_total = unread_bytes ;93 memmove(d->buffer + offset, d->bits_reader.buff, unread_bytes); 94 d->bits_reader.buff = d->buffer + offset; 95 d->bytes_total = unread_bytes + offset; 92 96 } 93 97 bytes2read = d->r->read(d->r, d->buffer + d->bytes_total, bytes2read);
Note: See TracChangeset
for help on using the changeset viewer.