FS#10790 - Support for MPEG-4 'isom' brand

Attached to Project: Rockbox
Opened by Ori Avtalion (salty-horse) - Monday, 16 November 2009, 01:32 GMT
Last edited by Magnus Holmgren (learman) - Sunday, 22 November 2009, 17:19 GMT
Task Type Patches
Category Codecs
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Using r23643

While playing the attached song.m4a (truncated), the simulator reported the following error:

Unknown MP4 file type: 'isom'

I have tried adding the 'isom' magic number to the various checks that cause that error (see patch), and now the file plays fine in the simulator.

However, it fails to play on my Sansa e280. The player goes through all of the files in the directory, while loading their metadata, and then returns to the directory file list without crashing.

Any help with adding support for 'isom' will be greatly appreciated. The relevant ISO standard is here:
This task depends upon

Closed by  Magnus Holmgren (learman)
Sunday, 22 November 2009, 17:19 GMT
Reason for closing:  Accepted
Additional comments about closing:  Committed, with an additional fix. Seem to work as well as other MP4/AAC files now (e.g., metadata need to be at the beginning of the file).
Comment by Ori Avtalion (salty-horse) - Wednesday, 18 November 2009, 22:45 GMT
Correction: No metadata is being loaded on the Sansa.
Comment by Magnus Holmgren (learman) - Sunday, 22 November 2009, 13:10 GMT
The attached file fails because it is truncated. A final seek in read_mp4_container fails on target because of it (not sure if that is proper behavior; should seeking past end-of-file really return an error?). Adding a "if (id3->filesize == 0)" guard to the lseek at the end of the loop in read_mp4_container makes the file work for me. Not a bad idea to add that guard regardless of lseek behavior; the final seek isn't needed.

Don't know if this seek is the problem with non-truncated files.