From 47813c5a7fbe990257b8f1511d098f63a1b27247 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Thu, 12 Nov 2015 14:10:09 +0900 Subject: [PATCH] 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. --- taglib/riff/aiff/aiffproperties.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.40.0