Improve decoder's ability to distinguish between a FLAC sync code and an MPEG one (SF #2491433 https://sourceforge.net/tracker2/?func=detail&aid=2491433&group_id=13478&atid=113478

This commit is contained in:
Josh Coalson
2009-01-07 06:54:05 +00:00
parent ee51fc0bae
commit bd161c61fa
3 changed files with 13 additions and 9 deletions

View File

@@ -1407,7 +1407,7 @@ FLAC__bool find_metadata_(FLAC__StreamDecoder *decoder)
decoder->private_->lookahead = (FLAC__byte)x;
decoder->private_->cached = true;
}
else if(x >> 2 == 0x3e) { /* MAGIC NUMBER for the last 6 sync bits */
else if(x >> 1 == 0x7c) { /* MAGIC NUMBER for the last 6 sync bits and reserved 7th bit */
decoder->private_->header_warmup[1] = (FLAC__byte)x;
decoder->protected_->state = FLAC__STREAM_DECODER_READ_FRAME;
return true;
@@ -1977,7 +1977,7 @@ FLAC__bool frame_sync_(FLAC__StreamDecoder *decoder)
decoder->private_->lookahead = (FLAC__byte)x;
decoder->private_->cached = true;
}
else if(x >> 2 == 0x3e) { /* MAGIC NUMBER for the last 6 sync bits */
else if(x >> 1 == 0x7c) { /* MAGIC NUMBER for the last 6 sync bits and reserved 7th bit */
decoder->private_->header_warmup[1] = (FLAC__byte)x;
decoder->protected_->state = FLAC__STREAM_DECODER_READ_FRAME;
return true;