Trevize wrote:I would bet they will never change their channel layout only because an open source ac3 decoder uses a different one.
Actually, it's the only thing on the entire platform which uses it. The only AC3 support Apple has ever provided is an encoder in their Pro apps (for DVDs) and passthrough. Neither need a channel layout defined in QuickTime. Furthermore, the only documentation I have ever seen for channel layout in CoreAudio (not QuickTime) mandates a layout of L R C LFE Ls Rs with missing channels skipped.
Trevize wrote:Well, clearly apple didn't take it only as a channel count as it uses the layout written in these specs in their mp4 importer
Trevize wrote:Yeah maybe ETSI and Apple did a stupid thing
AC3 is unique in that it knows which channel information belongs to which channel. Some compressors encode each channel individually, in which case the codec need not know the layout (but the player does), but AC3 is not one of those. So, defining a channel order in the spec not only unnecessary, it is misleading.
Trevize wrote:And I see that they added the following layout in CoreAudioTypes.h
That's rather moot as I can see there is no definition for 3_2_1 (5.1) which is by far the most popular.
Apple made several mistakes here, all of which in concert lead to this problem. If they correct any of them, it will entirely fix it.
- They defined the channel order as part of the AudioStreamBasicDescription only
- They don't communicate channel order between QuickTime and CoreAudio components
- They don't take into account that CoreAudio has a predefined channel order but instead expect channel order in the one defined in the AudioStreamBasicDescription (and not communicated to the CA component)
- They started using a channel order which is different from the only thing on the platform which uses it.
It could be possible that communication of channel order does exist, but I have not seen it documented anywhere, and my attempts to guess at it resulted in QuickTime ignoring the information my component provided, or it never querying/setting it. If someone could provide the information on how this is done, then I can modify the interleaver to handle it (since liba52 gives a completely different order, one already exists in the code).