[MPlayer-dev-eng] [PATCH] latm faad handling

Diego Biurrun diego at biurrun.de
Fri Jun 18 11:23:28 CEST 2010


On Wed, Jun 16, 2010 at 09:14:05PM +0200, Dan Oscarsson wrote:
> Many mpeg-ts streams with LATM do not work correctly. From what I could
> see this is because mplayer do not recognise it is LATM. In a previous
> patch I posted I added so aac_probe tried to located LATM header. This
> worked better but not for all files. I have now done further tests and
> they showed that what looks like a LATM header is not always a working
> LATM header.
> 
> The following patch works for all my files with LATM or AAC audio.
> 
> It does:
> 
>  - libfaad2 already implements LATM header searching and verification
>    so I have added so you can call faad2's init and have it return
>    failure if LATM is not found.
> 
>  - in ad_faad.c: first look for LATM using faad2,
>    if this fails and it is a mpeg-ts-stream with LATM in,
>        probe further in audio stream for LATM (tests show
>        that this is necessary),
>    if no LATM is found, do like before, probe using aac_probe
>    for a AAC stream header and call faad init.
> 
>  - demux_ts.c is enhanced to recognise the AAC LATM header tag
>    so that ad_faad.c can know when to search for LATM.

Maybe you can split the patch then?

> --- libmpdemux/demux_ts.c.org	2010-06-12 17:25:59.080522959 +0200
> +++ libmpdemux/demux_ts.c	2010-06-12 17:28:45.068522513 +0200
> @@ -246,7 +247,7 @@
>  
>  
> -#define IS_AUDIO(x) (((x) == AUDIO_MP2) || ((x) == AUDIO_A52) || ((x) == AUDIO_LPCM_BE) || ((x) == AUDIO_AAC) || ((x) == AUDIO_DTS) || ((x) == AUDIO_TRUEHD))
> +#define IS_AUDIO(x) (((x) == AUDIO_MP2) || ((x) == AUDIO_A52) || ((x) == AUDIO_LPCM_BE) || ((x) == AUDIO_AAC) || ((x) == AUDIO_DTS) || ((x) == AUDIO_TRUEHD) || ((x) == AUDIO_AAC_LATM))

You could break this long line while you're at it..

Diego



More information about the MPlayer-dev-eng mailing list