Summary: | timePerFrame incorrectly calculated in mpegproperties.cpp | ||
---|---|---|---|
Product: | [Unmaintained] taglib | Reporter: | Stephen F. Booth <me> |
Component: | general | Assignee: | Scott Wheeler <wheeler> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Other | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Stephen F. Booth
2007-04-07 20:30:00 UTC
SVN commit 689510 by wheeler: Promote the int to a float so that the calcualtion works properly. Patch from Stephen Booth. BUG:143938 M +1 -1 mpegproperties.cpp --- trunk/kdesupport/taglib/taglib/mpeg/mpegproperties.cpp #689509:689510 @@ -213,7 +213,7 @@ { 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; } |