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

Martin Ebourne lists at ebourne.me.uk
Thu Dec 15 18:57:23 EST 2005


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'll go through a couple of other things with the patch you've applied and
where you've made comments in avformatdecoder.cpp:

    // HACK BEGIN REALLY UGLY HACK FOR DTS PASSTHRU
    if (enc->codec_id == CODEC_ID_DTS)
    {
        enc->sample_rate = 48000;
        enc->channels = 2;
        // enc->bit_rate = what??;
    }
    // HACK END REALLY UGLY HACK FOR DTS PASSTHRU

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.

    // BEGIN Is this really safe? -- dtk
    if (data_size <= 0)
    {
        ptr += ret;
        len -= ret;
        continue;
    }
    // END 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.

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

Thanks for doing this, it all looks good. I'll compile it up and test
again.

Cheers,

Martin.



More information about the mythtv-dev mailing list