MAD Decoder: Correct length of iTunes MP3 files

The total frames count in the iTunSMPB header is the encoded length, so
add the start and end padding to it for the decoder implementation,
which expects this variable to contain the total decodable length
including the start and end padding. Fixes gapless decoding of iTunes
files.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CQTexperiment
Christopher Snowhill 2022-03-07 23:59:14 -08:00
parent 183a03657d
commit 9a0c598cf1
1 changed files with 2 additions and 1 deletions

View File

@ -163,7 +163,8 @@
if(end_pad >= 528 + 1) {
_startPadding = start_pad + 528 + 1;
_endPadding = end_pad - (528 + 1);
totalFrames = temp_duration;
// iTunes encodes the original length of the file here
totalFrames = temp_duration + _startPadding + _endPadding;
_foundiTunSMPB = YES;
}
}