[mythtv-commits] Ticket #6626: mythtranscode selecting wrong audio track

MythTV mythtv at cvs.mythtv.org
Fri Jun 12 12:03:10 UTC 2009

#6626: mythtranscode selecting wrong audio track
 Reporter:  anonymous               |       Owner:  ijr    
     Type:  defect                  |      Status:  new    
 Priority:  minor                   |   Milestone:  unknown
Component:  MythTV - Mythtranscode  |     Version:  head   
 Severity:  medium                  |     Mlocked:  0      
 I don't know if this is by design or a fault

 mythtranscode --chanid 1502 --starttime 20090612132700 -v all --profile
 autodetect --fifodir
 2009-06-12 17:48:16.498 AFD: Trying to select audio track (w/lang)
 2009-06-12 17:48:16.498 AFD: Selected track 2: English AC3 2ch (A/V Stream
 2009-06-12 17:48:16.498 AFD: Initializing audio parms from audio track #2
 2009-06-12 17:48:16.498 AFD: Audio format changed
                         from id(NONE)    -1Hz -1ch   0bps    ; id(NONE)
 -1Hz -1ch   0bps
                         to   id( AC3) 48000Hz  2ch  16bps    ; id( AC3)
 48000Hz  2ch  16bps
 2009-06-12 17:48:16.499 Dec: Trying to select track (w/lang)
 2009-06-12 17:48:16.499 Dec: Selecting first track
 2009-06-12 17:48:16.499 Dec: Selected track #1 in the Unknown language(0)
 2009-06-12 17:48:16.499 Dec: Selected track #1 in the English

 So AvFormatDecoder selects the AC3 track. This is then ignored and
 decoderbase selects the first audio track.
 This looks to be due to avformatdecoder.cpp at some time having a new
 method AutoSelectAudioTrack and AutoSelectTrack set as

 // documented in decoderbase.cpp
 int AvFormatDecoder::AutoSelectTrack(uint type)
     if (kTrackTypeAudio == type)
         return AutoSelectAudioTrack();

     if (ringBuffer->InDVDMenuOrStillFrame())
         return -1;

     return DecoderBase::AutoSelectTrack(type);


 So if AvFormatDecoder::AutoSelectTrack is used AutoSelectAudioTrack will
 be used to get audio track. If DecoderBase::AutoSelectTrack is used the
 first will be returned.

 Is this incorrect behaviour? if so could
 a) decoderbase.h be changed to call AvFormatDecoder::AutoSelectTrack (This
 seems a hack to me, where else is DecoderBase::AutoSelectTrack used) e.g.

 inline void DecoderBase::AutoSelectTracks(void)
     for (uint i = 0; i < kTrackTypeCount; i++)

 b) move AutoSelectAudioTrack to decoderbase.cpp and change
 DecoderBase::AutoSelectTrack to use it like
 AvFormatDecoder::AutoSelectTrack currently does, then remove

Ticket URL: <http://svn.mythtv.org/trac/ticket/6626>
MythTV <http://www.mythtv.org/>

More information about the mythtv-commits mailing list