mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
A bit more accurate calculation of the AIFF audio length.
Actually, it's unlikely to improve the accuracy, but prevents a useless round-trip conversion between double and int.
This commit is contained in:
parent
94ff9124c7
commit
47813c5a7f
@ -179,7 +179,7 @@ void RIFF::AIFF::Properties::read(File *file)
|
||||
d->sampleRate = static_cast<int>(sampleRate + 0.5);
|
||||
|
||||
if(d->sampleFrames > 0 && d->sampleRate > 0) {
|
||||
const double length = d->sampleFrames * 1000.0 / d->sampleRate;
|
||||
const double length = d->sampleFrames * 1000.0 / sampleRate;
|
||||
d->length = static_cast<int>(length + 0.5);
|
||||
d->bitrate = static_cast<int>(streamLength * 8.0 / length + 0.5);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user