- Status Closed
- Percent Complete
- Task Type Bugs
- Category Music playback
- Assigned To No-one
- Operating System All players
- Severity Low
- Priority Very Low
- Reported Version Version 3.1
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#10067 - FLAC, Divide by zero error
Using Rockbox 3.2, when playing FLAC files shorter than a second causes the following error:
Divide by zero at 01E56B90
Dreamlayers (Boris Gjenero) already located the source of the error so he deserves credit. Forum post of complete findings:
http://forums.rockbox.org/index.php?topic=21061.msg147362#msg147362
Here’s the bug, in flac_init():
/* Calculate track length (in ms) and estimate the bitrate (in kbit/s) */ fc->length = (fc->totalsamples / fc->samplerate) * 1000;
That’s integer division, so if the track is shorter than a second, the result is zero. For example, here’s GDB after playing Worms - Jock - Ya Can What Side Yer On.flac, Worms - Jock - Ya Numpty.flac on the r20528 5G iPod sim:
Program received signal SIGFPE, Arithmetic exception.
[Switching to thread 4880.0×818]
0x030a16d5 in flac_init (fc=0x6adfcb0, first_frame_offset=0)
at /home/Boris/rockbox-dev/apps/codecs/flac.c:175
175 fc→bitrate = ((fc→filesize-fc→metadatalength) * 8 ) / fc→length;
(gdb) p fc→totalsamples
$1 = 16383
(gdb) p fc→samplerate
$2 = 22050
(gdb)
Attached are 3, royalty free, FLAC files that are shorter than a second so whoever takes up this task can test it out.
If any other information is needed please don’t hesitate to ask.
2009-03-29 15:09
Reason for closing: Fixed
Additional comments about closing: Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407
Fixed in r20567.
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task