Amend an outdated comment.

This commit is contained in:
Tsuda Kageyu 2016-01-09 10:13:07 +09:00
parent 3dc873b7d0
commit b8e82a7775

View File

@ -299,13 +299,15 @@ void MPEG::Header::parse(File *file, long offset, bool checkLength)
if(d->isPadded)
d->frameLength += paddingSize[layerIndex];
// Check if the frame length has been calculated correctly, or the next frame
// synch bytes are right next to the end of this frame.
// We read some extra bytes to be a bit tolerant.
if(checkLength) {
// Check if the frame length has been calculated correctly, or the next frame
// header is right next to the end of this frame.
// The MPEG versions, layers and sample rates of the two frames should be
// consistent. Otherwise, we assume that either or both of the frames are
// broken.
file->seek(offset + d->frameLength);
const ByteVector nextData = file->readBlock(4);
@ -314,10 +316,6 @@ void MPEG::Header::parse(File *file, long offset, bool checkLength)
return;
}
// The MPEG versions, layers and sample rates of the two frames should be
// consistent. Otherwise, we assume that either or both of the frames are
// broken.
const unsigned int HeaderMask = 0xfffe0c00;
const unsigned int header = data.toUInt(0, true) & HeaderMask;