Well, what it really requires is for someone to look up the rule used for audio streams in MPEG2 files. There must be some sort of rule, otherwise stand alone DVD players and HDTVs would get it wrong. In my (limited) testing, DVDs appear to follow a pattern of the highest numbered track that meets the desired number of channels. However, it's possible there's some sort of flag to indicate this.
I did some digging around last night, and here's what I found out. AC3 audio streams (used by ATSC and DVD) contain information in their headers about (among other things) number of channels and channel format, language code, "bitstream mode" (indicating the intended use of the stream, i.e. main program; visually impaired; etc.), and flags that indicate if the stream stands on its own, or is intended to be combined with other streams to make a whole (and if so, which). The MPEG-TS headers (for ATSC, and presumably DVB) also contain this info.
libavformat/libavcodec expose none of this except number of channels, and even that is not properly initialized (always 2) by the time we use it in avformatdecoder.cpp. My immediate problem would be solved if I fixed this bug, because it turns out the DVS stream is mono. But IMO in order to make an intelligent auto-selection, having all the info outlined above would be helpful.
Daniel had discussed some of this here before in the context of *recording* the proper audio stream: http://mythtv.org/pipermail/mythtv-dev/2004-March/020139.html
-Doug
signature.asc
Description: OpenPGP digital signature
_______________________________________________ mythtv-dev mailing list [email protected] http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
