Promote the int to a float so that the calcualtion works properly. Patch from Stephen Booth.

BUG:143938


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@689510 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Scott Wheeler 2007-07-18 12:52:07 +00:00
parent 1faa305dcc
commit 951ef149d2

View File

@ -213,7 +213,7 @@ void MPEG::Properties::read()
{
static const int blockSize[] = { 0, 384, 1152, 1152 };
double timePerFrame = blockSize[firstHeader.layer()] / firstHeader.sampleRate();
double timePerFrame = double(blockSize[firstHeader.layer()]) / firstHeader.sampleRate();
d->length = int(timePerFrame * d->xingHeader->totalFrames());
d->bitrate = d->length > 0 ? d->xingHeader->totalSize() * 8 / d->length / 1000 : 0;
}