[MPlayer-dev-eng] [PATCH] MPEG(2/4) AAC decoder

Diego Biurrun diego at biurrun.de
Sun Feb 13 17:38:08 CET 2011


On Sun, Feb 13, 2011 at 11:59:20PM +0900, Naoya OYAMA wrote:
> I write audio decoder.
> AAC passthrough

Thanks.

Please resend your patch attached, your mailer mangled it.

Please reformat the new file you added in K&R style, 4 spaces
indentation, no tabs, no trailing whitespace; some hints below.

> --- libmpcodecs/ad_hwaac.c	(revision 0)
> +++ libmpcodecs/ad_hwaac.c	(revision 0)
> @@ -0,0 +1,173 @@
> +
> +static const ad_info_t info =
> +{

static const ad_info_t info = {

> +static int aac_sync(sh_audio_t *sh, int no_frames, int *n, int
> *srate, int *num)
> +{

No need to break this line.

> +	do
> +	{
> +		while(cnt + 8 < sh->a_in_buffer_len)
> +		{
> +			x = aac_parse_frame(&(sh->a_in_buffer[cnt]), srate, num);
> +			if(x != 0)
> +			{
> +				frames_count++;
> +				if(frames_count == no_frames)
> +				{

Please use K&R style; add spaces between keywords and (, keep { on
the same line as if/for/while/switch/do control flow keywords.

> +		len = demux_read_data(sh->ds,&sh->a_in_buffer[sh->a_in_buffer_len],sh->a_in_buffer_size-sh->a_in_buffer_len);

Add spaces after commas and please break this long line.

> +static int preinit(sh_audio_t *sh)
> +{
> +	sh->audio_out_minsize = 4096;//check
> +	sh->audio_in_minsize =  4096;//check
> +	sh->channels = 2;
> +	sh->samplesize = 2;
> +	sh->sample_format = AF_FORMAT_AAC_LE;

Please align the '='.

> +static int control(sh_audio_t *sh,int cmd,void* arg, ...)
> +{
> +	int start, len;
> +
> +	switch(cmd)
> +	{
> +		case ADCTRL_RESYNC_STREAM:

Indent case at the same level as switch.

> --- Makefile	(revision 32893)
> +++ Makefile	(working copy)
> @@ -340,6 +340,7 @@
>                libmpcodecs/ad_dvdpcm.c \
>                libmpcodecs/ad_hwac3.c \
>                libmpcodecs/ad_hwmpa.c \
> +              libmpcodecs/ad_hwaac.c \
>                libmpcodecs/ad_imaadpcm.c \
>                libmpcodecs/ad_msadpcm.c \
>                libmpcodecs/ad_pcm.c \

alphabetical order

> --- libaf/af_format.h	(revision 32893)
> +++ libaf/af_format.h	(working copy)
> @@ -58,9 +58,10 @@
>  // Special flags refering to non pcm data
>  #define AF_FORMAT_MU_LAW	(1<<6)
>  #define AF_FORMAT_A_LAW		(2<<6)
> -#define AF_FORMAT_MPEG2		(3<<6) // MPEG(2) audio
> +#define AF_FORMAT_MPEG2		(3<<6) // MPEG(2) BC audio

Have you verified that AF_FORMAT_MPEG2 is really only use for MPEG-2
BC audio and not for other types of MPEG audio?

Diego


More information about the MPlayer-dev-eng mailing list