mirror of
https://github.com/taglib/taglib.git
synced 2026-04-12 17:09:50 -04:00
Fix bitrate calculation unit errors in ADTS and MP4 ESDS parsers (#1330)
mpegheader.cpp: ADTS bitrate divided by 1024 (binary kilo) instead of 1000 (decimal kilo), causing ~2.4% underreporting for all AAC streams. mp4properties.cpp: ESDS averageBitrate double-rounded via both +500 and +0.5 before int cast, causing standard bitrates (128000, 192000, etc.) to read 1 kbps too high.
This commit is contained in:
@ -239,7 +239,7 @@ void MPEG::Header::parse(File *file, offset_t offset, bool checkLength)
|
||||
(static_cast<unsigned char>(frameLengthData[0]) << 3) |
|
||||
(static_cast<unsigned char>(frameLengthData[1]) >> 5);
|
||||
|
||||
d->bitrate = static_cast<int>(d->frameLength * d->sampleRate / 1024.0 + 0.5) * 8 / 1024;
|
||||
d->bitrate = static_cast<int>(d->frameLength * d->sampleRate / 1024.0 + 0.5) * 8 / 1000;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user