FS#10476 - FLAC bitrate calculation overflows with large files

Attached to Project: Rockbox
Opened by Boris Gjenero (dreamlayers) - Friday, 31 July 2009, 01:32 GMT
Last edited by Boris Gjenero (dreamlayers) - Saturday, 08 August 2009, 20:36 GMT
Task Type Patches
Category ID3 / meta data
Status Closed
Assigned To No-one
Operating System SW-codec
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


While playing a 561,500,563 byte FLAC file in r22076 on a 5G iPod, I get some pauses when the buffer is being refilled.

Bitrate calculation overflows when the filesize is multiplied by 8. The calculated bitrate is incorrect and very low. This may be seen in "Show track info". The bitrate is used to calculate the watermark, resulting in an unreasonably low watermark.

I'm attaching a patch which fixes the calculation both in the metadata code and the FLAC codec. The metadata code is responsible for the above observations.
This task depends upon

Closed by  Boris Gjenero (dreamlayers)
Saturday, 08 August 2009, 20:36 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in r22211