Bug #425

Certain .m4a files do not play

Added by John Lindgren over 2 years ago. Updated over 2 years ago.

Status:Closed Start date:April 01, 2014
Priority:Minor Due date:
Assignee:- % Done:


Target version:3.6
Affects version:3.5-beta1


As mentioned on the forum [1], some .m4a files do not play in Audacious. The example file provided [2] can be played fine using VLC or ffplay.

[1] http://redmine.audacious-media-player.org/boards/1/topics/1117
[2] http://redmine.audacious-media-player.org/attachments/download/354/Jimi%20Hendrix%20-%20Spanish%20Castle%20Magic.m4a

Associated revisions

Revision 900a8388
Added by John Lindgren over 2 years ago

Remove mp4ff-based AAC plugin. Move iTunes cover art support to ffaudio. Closes: #425.


#1 Updated by John Lindgren over 2 years ago

Technical details:

The MP4 container in this example file has an empty "time-to-sample atom", a.k.a. seek table [1]. The MP4 demuxer used in Audacious (mp4ff, part of libfaad) needs the seek table to work correctly. Running faad from a terminal also fails to decode the example file, reporting that it is "0.000 secs". Instead of mp4ff, some other players (VLC, for example) use FFmpeg's MP4 demuxer, which can handle files without a valid seek table.


1. Disable the AAC (MP4) Decoder in Audacious. Audacious will then fall back on its FFmpeg plugin, which can play the file.

2. Use FFmpeg to remux the file, building a new seek table. Note that this is a lossless operation that does not involve re├źncoding the audio data. Example terminal command:

$ ffmpeg -i in.m4a -acodec copy -movflags faststart out.m4a

Long-term solutions:

Patching mp4ff is not a workable solution since much of its API is based on the assumption that a seek table is available; also, upstream apparently discourages the use of mp4ff outside libfaad [2]. faad itself has not seen a release since 2009.

That leaves three options:

1) Keep the current MP4/AAC plugin and do not support MP4 files without a valid seek table.

2) Remove the current MP4/AAC plugin altogether and rely on the FFmpeg plugin ("ffaudio") to play all MP4 files. FFmpeg is already used for other audio codecs (Apple Lossless, for example) within MP4 containers, so this would make format detection simpler.

3) Write a new MP4 plugin for Audacious using a different demuxer. mp4v2 [3] was suggested on the Debian bug report mentioned earlier [2]. I'm not sure if this has any clear advantage over 2), other than keeping format-specific code like the album art support (itunes-cover.c) out of ffaudio.

The latter two options involve changes that are too big to make before Audacious 3.5, but they should be considered for 3.6.

[1] https://developer.apple.com/library/mac/documentation/QuickTime/qtff/QTFFChap2/qtff2.html (search for "stts")
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550679#62
[3] http://code.google.com/p/mp4v2/

#2 Updated by John Lindgren over 2 years ago

  • Status changed from New to Closed
  • Target version set to 3.6
  • % Done changed from 0 to 100

Also available in: Atom PDF