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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Jun 17 22:05:38 CEST 2010


On Wed, Jun 16, 2010 at 09:14:05PM +0200, Dan Oscarsson wrote:
> +    if (faac_init < 0 && sh->format == mmioFOURCC('M', 'P', '4', 'L')) {
> +        // working LATM not found at first try, look further on in stream
> +        for (int i = 0; i < 5; i++) {

Move the "int" out, this will not work with some older compilers.

> +            pos = sh->a_in_buffer_len-3;

This can overflow (or rather underfflow).

> +            memmove(sh->a_in_buffer, &(sh->a_in_buffer[pos]), 3);

Pointless ().

> --- 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
> @@ -85,6 +85,7 @@
>  	SL_PES_STREAM	= 0xD000000,
>  	SL_SECTION	= 0xD100000,
>  	MP4_OD		= 0xD200000,
> +	AUDIO_AAC_LATM	= mmioFOURCC('M', 'P', '4', 'L'),
>  } es_stream_type_t;
>  
>  typedef struct {
> @@ -246,7 +247,7 @@
>  } TS_pids_t;
>  
>  
> -#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))
>  #define IS_VIDEO(x) (((x) == VIDEO_MPEG1) || ((x) == VIDEO_MPEG2) || ((x) == VIDEO_MPEG4) || ((x) == VIDEO_H264) || ((x) == VIDEO_AVC)  || ((x) == VIDEO_DIRAC) || ((x) == VIDEO_VC1))
>  #define IS_SUB(x) (((x) == SPU_DVD) || ((x) == SPU_DVB) || ((x) == SPU_TELETEXT))
>  
> @@ -875,6 +876,8 @@
>  		mp_msg(MSGT_DEMUXER, MSGL_INFO, "AUDIO LPCM(pid=%d)", param->apid);
>  	else if(param->atype == AUDIO_AAC)
>  		mp_msg(MSGT_DEMUXER, MSGL_INFO, "AUDIO AAC(pid=%d)", param->apid);
> +	else if(param->atype == AUDIO_AAC_LATM)
> +		mp_msg(MSGT_DEMUXER, MSGL_INFO, "AUDIO AAC LATM(pid=%d)", param->apid);
>  	else if(param->atype == AUDIO_TRUEHD)
>  		mp_msg(MSGT_DEMUXER, MSGL_INFO, "AUDIO TRUEHD(pid=%d)", param->apid);
>  	else
> @@ -2508,9 +2511,11 @@
>  				pmt->es[idx].type = VIDEO_MPEG4;
>  				break;
>  			case 0x0f:
> -			case 0x11:
>  				pmt->es[idx].type = AUDIO_AAC;
>  				break;
> +			case 0x11:
> +				pmt->es[idx].type = AUDIO_AAC_LATM;
> +				break;
>  			case 0x1b:
>  				pmt->es[idx].type = VIDEO_H264;
>  				break;

I guess this can be applied already given that Nico seems ok with it.
Though those IS_.. macros are getting really unyieldly.



More information about the MPlayer-dev-eng mailing list