From: Tsuda Kageyu Date: Thu, 12 Nov 2015 05:10:09 +0000 (+0900) Subject: A bit more accurate calculation of the AIFF audio length. X-Git-Tag: v1.11beta~158 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47813c5a7fbe990257b8f1511d098f63a1b27247;p=taglib 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. --- diff --git a/taglib/riff/aiff/aiffproperties.cpp b/taglib/riff/aiff/aiffproperties.cpp index e345fb0c..f074fae3 100644 --- a/taglib/riff/aiff/aiffproperties.cpp +++ b/taglib/riff/aiff/aiffproperties.cpp @@ -179,7 +179,7 @@ void RIFF::AIFF::Properties::read(File *file) d->sampleRate = static_cast(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(length + 0.5); d->bitrate = static_cast(streamLength * 8.0 / length + 0.5); }