mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
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:
parent
1faa305dcc
commit
951ef149d2
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user