mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
Use floting point length to calculate bitrate from the Xing header information
Patch by Mook BUG:172556 git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@994337 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
parent
bed793f703
commit
b70e3b2304
@ -218,8 +218,10 @@ void MPEG::Properties::read()
|
||||
double timePerFrame =
|
||||
double(firstHeader.samplesPerFrame()) / firstHeader.sampleRate();
|
||||
|
||||
d->length = int(timePerFrame * d->xingHeader->totalFrames());
|
||||
d->bitrate = d->length > 0 ? d->xingHeader->totalSize() * 8 / d->length / 1000 : 0;
|
||||
double length = timePerFrame * d->xingHeader->totalFrames();
|
||||
|
||||
d->length = int(length);
|
||||
d->bitrate = d->length > 0 ? d->xingHeader->totalSize() * 8 / length / 1000 : 0;
|
||||
}
|
||||
else {
|
||||
// Since there was no valid Xing header found, we hope that we're in a constant
|
||||
|
Loading…
x
Reference in New Issue
Block a user