[mythtv] [patch]: various audio selection problems with DVDs

Martin Kittel linux at martin-kittel.de
Sun Nov 22 19:35:29 UTC 2009


I took a shot at some problems that came up when trying to watch a DVD
with many streams. On this DVD not all streams were present from the
very beginning of the feature but some of them got added only one after
another over the course of the first couple of minutes. The effect was
usually that the internal player always would switch back to audio track
no 0 whenever a new stream was detected.

Here's a list of the issues I found:

1. the order in which the audio streams are saved does not match their
logical order on DVD because the audio streams get sorted by streamid in
'AvFormatDecoder::ScanStreams'. Due to this if one selects a track in
the 'Select Audio Track' OSD (or in the DVD menu itself), a different
audio track than the one selected will be played if the logical order
and the order of stream ids does not match (in my case I had a mix of
AC3 and DTS channels and due to the sorting the DTS channel was always
last while it was the second logical track on the DVD according to dvdnav).
I solved this by simply removing the sorting of the audio tracks. This
is the one fix I am not certain about. Is the sorting actually needed
someplace else? In that case the logical track position should be added
to the StreamInfo object (which is not what I did).

2. The DVD I was testing with gave me no result for the language code in
'AvFormatDecoder::ScanStreams', so internally always the 'Unknown
Language' was set for the audio streams.
I added a lookup via dvdnav for the language to get the correct result.

3. Problem 2 actually shadowed a bug in
'AvFormatDecoder::AutoSelectAudioTrack' which would stop the language
selection early if more than 1 language existed in the source.

4. Switching audio streams via OSD did not switch the state in
'DVDRingBufferPriv' accordingly so that if
'AvFormatDecoder::ScanStreams' got triggered, I ended up with the
initial audio stream from the DVD again.

The patch is against release0-22-fixes as I do not have a working
version of trunk set up yet. However I checked and at least it still
applies to trunk.

Please let me know in case of questions or if I should open a ticket for
these issues.

Best wishes,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dvdaudio.patch
Type: text/x-diff
Size: 2654 bytes
Desc: not available
URL: <http://mythtv.org/pipermail/mythtv-dev/attachments/20091122/fe04b97f/attachment.patch>

More information about the mythtv-dev mailing list