AC3 channel layout (again) proposal & implementation
|Reported by:||rovers||Owned by:|
Problem: Apple's AC3 importer and MP4 files assume a channel layout as in the AC3 specs. This makes sense as it is an AC3 bitstream. Codecs can specify which channel layout they expect at input and which they produce at the output, but this is not used by QuickTime. Instead QuickTime assumes the same channel layout after decompressing and codecs are never told the layout.
Unfortunately Perian's AC3 importer that existed before Apple's uses a different channel layout for importing, which QuickTime uses as the output layout. But the AC3 bitstream decodes to a fixed layout and as QuickTime does not tell the used input layout or the requested output layout, we don't know which to layout to use for the output.
Proposal: Add an "Apple compatibility mode" as a preference. When enabled it will import and assume everything with the Apple layout. Attached is a diff that is tested with Apple's AC3 import and MP4 files on stereo and passthrough SPDIF output. Also changing the import layout for avi and Matroska files in Perian in this mode, allow you to use this mode for all files.
- no more layout problems with Apple by giving in...
- works also for MP4 files, and with Apple's AC3 importer.
- breaks previously imported .mov files.
- downmixing to stereo or dolby pro logic does not work anymore, because apple thinks the layout is "Left, Center" for 2 channel outputs of multi-channel AC3-files with center channels, so downmixing is disabled and left to QuickTime (which works fine).
defaults write org.perian.Perian compatabilityMode 1
defaults write org.perian.Perian compatabilityMode 0
Hope it's useful. Would make my life easier if it is included.