mozilla-b2g/gaia — pull request #4466 by davidflanagan (2012-09-07 20:07:03+00:00)
Title: Efficient metadata parsing for the Music app

This pull request replaces apps/music/js/ext/*.js and apps/music/js/MetadataParser.js with apps/music/js/metadata.js and shared/js/blobview.js

This new metadata parser:

1) does not read the entire music file, so it should be much more memory efficient

2) uses typed arrays rather than binary strings, so it should be more time efficient, too.

3) does not extract album art from the music files, but instead just stores the location of the art within the files, to save space in the metadata database.

4) extracts track number metadata, which seems like it might be useful to the music app for sorting songs within an album

5) supports id3 v1 and v2 tags for mp3 files, itunes metadata in AAC .m4a files, and ogg comments for ogg files.

The changes to music.js and utils.js mostly have to do with the new way that album art is stored. But there are also several changes to remove onload event listeners from image elements. It looked like there was code that may have been registering the same listener over and over.

I don't have a large music collection to test this against, but it seems to work correctly for me.

@dominickuo would you review this, please?
@timdream are you interested in reviewing metadata.js and the shared/js/blobview.js utility it depends on?