QuickTime 7 introduced support for multichannel audio, and Perian and A52Codec take advantage of that. However, there are some caveats to this support.
First, Perian 0.5 does not create a multichannel SoundDescription? for any audio tracks in AVIs, so it is limited to stereo. Perian 1.0 will create a correct multichannel SoundDescription? so that QuickTime's surround capabilities are properly used.
The bigger issue is how to get multichannel audio out of a Macintosh. The short of it is that currently the only way to get multichannel audio from QuickTime-based applications is to purchase and use a third-party sound card that provides 6 discrete analogue channels. This is due to how the S/PDIF standard handles 5.1 audio.
Digital Audio Through S/PDIF
S/PDIF supports a couple different audio formats - it can handle 2 or uncompressed audio or compressed audio. Some devices also support 4 channels of uncompressed audio, but this isn't common. As for compressed audio, pretty much only the only two codecs supported by receivers are AC3 and DTS due to their inclusion in the DVD standard. This means that a 5.1 audio stream out of the optical port has to be encoded in either AC3 or DTS.
This is a problem for computers since they support other multichannel formats, such as AAC (this includes many of Apple's trailers.) Thus, in order to get 5.1 audio out of these files, the AAC audio would have to be re-encoded to AC3 or DTS before sending the compressed audio through the optical port. Apple does not currently ship an AC3 or DTS encoder, so this cannot happen.
What about audio that's already encoded into AC3 or DTS audio? This could be passed through the optical port without modifying it. However, it is up to the application to handle this since it blocks all other audio, and currently only a few applications such as DVD player and VLC do this. Apple has considered implementing this for QuickTime, and may do so in the future (contacting Apple may convince them to implement it sooner.)
Potential Solutions
One hack around this limitation is to store compressed DTS or AC3 data inside a .wav file that pretends to contain uncompressed 2 channel PCM audio. When QuickTime or iTunes plays this file, it treats it as PCM audio, and the design of Mac OS X means that if everything is set up correctly, the audio is sent unmodified across the optical output. This is rather fragile however, as it depends on there being absolutely no modification of the audio by the system. If the application applies any filter to the audio, such as volume or an equalizer, or if another application attempts to play its own audio, this method breaks.
The AppleTV adds a new possibility with its HDMI port. HDMI supports 8 channels of uncompressed audio. However, not all devices support this and it is currently unknown whether the AppleTV does.
One possible solution for Macs is to write a virtual audio device driver that pretends to have 6 discrete channels, then mixes the audio from the system and encodes it to AC3 in real time as described by http://trac.cod3r.com/a52codec/ticket/14. This has the drawback of increased CPU usage and decreased quality, as AC3 is a lossy codec. Although the CPU usage shouldn't be more than about 10% and the quality loss won't be too bad at AC3's maximum bitrate of 640 kbps.
