Is there a way to play 5.1 surround via Apple TV? I have several albums on DVD with both Dolby Digital 5.1 and DTS 5.1 versions. I'd like to be able to listen to them without dealing with physical disks all the time.

I have no problem using ffmpeg to pull the audio data out and stick it in a file, but I haven't been able to find the magic format that will let it play via Apple TV. I've read that the Apple TV doesn't need to understand the format, it just needs to send the data to a receiver that does, which makes perfect sense, but how do I get it to do that? I can't get a WAV containing DTS to work.

If the solution ends up being to stick the AC3 data in a video container, that's fine, but ideally, I just want to store/play the audio (and ideally, it would be the DTS version).

I have both a 1st and a 3rd generation Apple TV (a.k.a. the Apple TV 2 with 1080p support), so any solution, old or new, will do.
Yes. The Apple TV can pass through 5.1 AC-3 to a receiver if you set up the file correctly. Apple has the full details in a knowledge base article, but basically you need to set up your mp4/m4v file with a stereo AAC as the default audio track, then put your AC-3 track after it, disabled. On the Apple TV, you need to enable it by turning on Dolby Digital Out in the Audio Settings.