This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10832 - Grok unstreamable AAC (mp4) files
Attached to Project:
Rockbox
Opened by Juliusz Chroboczek (jch) - Saturday, 05 December 2009, 18:49 GMT+2
Last edited by MichaelGiacomelli (saratoga) - Saturday, 02 January 2010, 22:05 GMT+2
Opened by Juliusz Chroboczek (jch) - Saturday, 05 December 2009, 18:49 GMT+2
Last edited by MichaelGiacomelli (saratoga) - Saturday, 02 January 2010, 22:05 GMT+2
|
DetailsRockbox doesn't currently grok mp4 files in which the mdat chunk comes before the moov chunk. While I don't have the mp4 specs (please contact me if you can give me a copy), such files are properly played by all the Linux players I've tested, as well as Apple's OF.
In order to generate such a file, simply do "mplayer -dumpaudio" on an mp4 movie. The attached patches add support for such files to rockbox. They work fine in the simulator, but unfortunately crash my iPod. Since I don't know how to debug code running on the iPod, I'll be grateful if anyone can help me working out what the problem is. --Juliusz |
This task depends upon
Closed by MichaelGiacomelli (saratoga)
Saturday, 02 January 2010, 22:05 GMT+2
Reason for closing: Accepted
Additional comments about closing: Accepted in r24147 and r24148.
Saturday, 02 January 2010, 22:05 GMT+2
Reason for closing: Accepted
Additional comments about closing: Accepted in r24147 and r24148.
FS#10833. With the latter patch applied, this code works fine on the iPod too.The main advantage of my patch over the one in
FS#10160is that I only do the seeking forwards and backwards if we didn't find the moov chunk before the mdat chunk. in the normal case (moov before mdat), the behaviour is unchanged from the current one -- we stream the file from the buffer without any seeking.FS#10833) and my "broken" m4a's all seem to be playing fine. From my point of view this patch seems good to go.Your right the excessive seeking caused by FS #10160 was one of the reasons it never got merged.
If you want to get the following applied to the tree your best bet is to get onto IRC and see if anyone is willing to review and commit the changes to the source tree.
1. These are perfectly correct mp4 files. The spec allows the metadata to precede the data (streamable files), or to follow it (unstreamable files, for one-pass writing). In other words, this attempts to fix an undocumented limitation in Rockbox, not to add a new feature. All players known to man (mplayer, vlc, iTunes, the iPod's OF) grok such files quite fine.
2. No performance hit is taken for streamable files (the only ones that we support right now). There is no regression.
3. For unstreamable files, we call bufadvance, which in turn calls bufseek. In the case where the whole track has been buffered (which should normally be the case), this does not result in actual disk I/O, just some pointer arithmetic inside the buffer. So unless you're really short on memory, or playing huge files, there will be no noticeable performance hit even for unstreamable files.
4. Yes, such files can be "fixed" by reordering the chunks. That is quite besides the point.
- the first two patches are for unstreamable files;
- the third patch adds support for skipping empty mdat chunks, which is a separate issue.
The first two look good to me, although I was hoping lear would comment since he actually knows something about mp4. I think they should go in regardless after the branch for 3.5. If no one beats me to it, I'll commit them all together after the branch.