[mythtv] Re: [mythtv-commits] Re: Ticket #730: Add DTS passthrough support

Daniel Kristjansson danielk at cuymedia.net
Thu Dec 15 19:14:52 EST 2005

On Thu, 2005-12-15 at 23:57 +0000, Martin Ebourne wrote:
> On Thu, 15 Dec 2005 15:49:13 -0500, Daniel Kristjansson wrote:
> > On Thu, 2005-12-15 at 01:29 +0000, MythTV wrote:
> >> #730: Add DTS passthrough support
> >> Comment (by martin at zepler.org):
> >>  Some crucial parts of the original patch were left out of Daniel's
> >>  version, those are back in now. There should be nothing extraneous.
> > 
> > Why have you changed DTS_ID in libs/libavformat/mpeg.c ?
> Sorry, famous last words, that was the one bit that was extraneous. It is
> technically correct, but should not be necessary in myth because as long
> as it always uses the same wrong number then it will still work. I might
> take that upstream. Originally I had several fixes in this file (back with
> 18.1) - the others were essential but got fixed already upstream so that
> was just left over.
I see, since as you say it shouldn't affect MythTV so long as we use
the same wrong number, I'd rather see this fixed upstream. When we make
these type of fixes we need to annotate them so they don't get lost
in the next ffmpeg merge.

> I'll go through a couple of other things with the patch you've applied and
> where you've made comments in avformatdecoder.cpp:
>     if (enc->codec_id == CODEC_ID_DTS)
>     {
>         enc->sample_rate = 48000;
>         enc->channels = 2;
>         // enc->bit_rate = what??;
>     }
> Is there a better place or way I can do this? It is unfortunately
> necessary but I'll happily test and submit a different solution if one is
> available.
This is only needed so that MythTV knows to pass this through as a two
channel 16 bit per sample stream at 48000 Hz, right? If so, you should
leave enc alone and it should be taken care of in SetupAudioStream()
where this is set as the audioOut when passthru is enabled. That is
it should be safe to just remove that bit of code, but since I can't
test this I just left it in. I left that hack notice in there, because
I'd like to be able to enable software decoded DTS at some point and
figured this was something that should be highlighted in the code.

>     // BEGIN Is this really safe? -- dtk
> Not only safe, but correct. In the case that the condition is not true
> then the same ptr/len adjustments are made just after the end of the
> switch statement in the 'if (!have_err)' block. Without the change it
> gets done twice and some sound goes missing (dts seems to put 2 frames in
> a packet, vs. ac3 which only uses one and therefore doesn't see this bug).
> The block after the switch statement also sets frame_decoded which doesn't
> appear to be used any more.
Ok, sounds reasonable. I'll remove those comments after you've tested
whether it is safe to remove the hack for dts passthru.

> Sorry about all the if(, I'll try and remember the space for next time.

-- Daniel

More information about the mythtv-dev mailing list