[mythtv] [mythtv-commits] Ticket #1104: multi channel audiosupport

Mark Spieth mark at dclabs.com.au
Mon Nov 5 23:37:01 UTC 2007

>> #1104: multi channel audio support
>> -------------------------+-------------------------------------------
>>  Reporter: Mark Spieth | Owner: ijr
>> Type: enhancement | Status: new
>> Priority: minor | Milestone: 0.21
>> Component: mythtv | Version: head
>> Severity: medium | Resolution:
>> Mlocked: 0 |
>> -------------------------+-------------------------------------------
> Hi Mark,
> I had quick look at mythtv_ac3.29.patch and noticed a few things:
> -the #if MAXCHANNELSELECT in avformatdecoder is ugly and seems to be
> unneeded

I think it is needed. what it does is allow maxchannels generated by the 
audio decoder to be tested and used further downstream where the number of 
channels available configures the output device.
It lets the codec do max channels that the play can cope with. this can be 
different in mythcommflag vs alsa.
I cheated and reused the cdp field for how many channels could be provided 
by the coded (as opposed to the number of channels asked for) for this 
purpose as it is unused by audio codecs. The re-encoder in audiooutput needs 
this info too so it matches the decoder.

> -are the changes to libavcodec/ac3dec really necessary? if yes, can you
> try to get them upstream?

only change to ac3 is now in ac3_parser.c to make ac3_sync globally exported 
(remove static).
a52dec.c had extensive changes and has been removed so it doesnt matter 
anymore. this was mainly for channel ordering to make it the same as ac3dec 
and dtsdec. not sure about the channel ordering in the new dtsdec 
replacement (dca?).

> -you're duplicating the DTS parsing functions in libmyth

this is true. it needs to be defined in libmyth so perhaps avf can use it 
from there. there may even be code to do the same thing in lavc now but 
after a quick look dca doesnt seem to have a sync.

funnily enough I was doing some tests on the latest patch only a couple of 
hours before you committed :-)
also I noticed that with libfaad and libfaac enabled, things dont link 
properly for me.
unless Im doing something terribly wrong, I had to put in libavcodec.pro

contains( CONFIG_LIBFAAC, yes )                 {
    SOURCES *= libfaac.c
    LIBS += -lfaac
contains( CONFIG_LIBFAAD, yes )                 {
    SOURCES *= libfaad.c
    !contains( CONFIG_LIBFAADBIN, yes )         {
        LIBS += -lfaad
also LIBA52 in this seems superfluous since a52dec is gone.

an OT question about how mpeg timestamp wrap is now handled. I havent 
figured it out yet but have removed my hack which resets the start for the 
stream. I noticed there is still a remnant in avf which still cancels the 
effects for seek of start offset. did you mean this? (search for lsb3full in 
unless ic->starttime in utils.c is set correctly this will do bad things.
I can get a patch for utils.c which Ive been using for years if it will 
My hack for mpeg timestamps set the start of stream to 0 and did the correct 
wrap. This only works for 26.5 hrs on an mpeg stream so is not universally 
generic but good enough.
How does the new one work?


More information about the mythtv-dev mailing list