comparison mlp_parser.c @ 7137:186eb61a9860 libavcodec

Make it a little easier to spot that the code is not dealing only with substream headers.
author ramiro
date Wed, 25 Jun 2008 12:08:39 +0000
parents f7cbb7733146
children a9ed669e8cd1
comparison
equal deleted inserted replaced
7136:7a73d76aaaa0 7137:186eb61a9860
241 if (!sync_present) { 241 if (!sync_present) {
242 // First nibble of a frame is a parity check of the first few nibbles. 242 // First nibble of a frame is a parity check of the first few nibbles.
243 // Only check when this isn't a sync frame - syncs have a checksum. 243 // Only check when this isn't a sync frame - syncs have a checksum.
244 244
245 parity_bits = 0; 245 parity_bits = 0;
246 for (i = 0; i <= mp->num_substreams; i++) { 246 for (i = -1; i < mp->num_substreams; i++) {
247 parity_bits ^= buf[p++]; 247 parity_bits ^= buf[p++];
248 parity_bits ^= buf[p++]; 248 parity_bits ^= buf[p++];
249 249
250 if (i == 0 || buf[p-2] & 0x80) { 250 if (i < 0 || buf[p-2] & 0x80) {
251 parity_bits ^= buf[p++]; 251 parity_bits ^= buf[p++];
252 parity_bits ^= buf[p++]; 252 parity_bits ^= buf[p++];
253 } 253 }
254 } 254 }
255 255