[mythtv] Prefer lower-numbered audio stream

Doug Larrick doug at ties.org
Wed Dec 29 14:00:09 UTC 2004


> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20041229/782d88f3/signature.pgp


More information about the mythtv-dev mailing list