[FFmpeg-devel] [PATCH]ExtraData computation for aac in -acodec copy

Carl Eugen Hoyos cehoyos at ag.or.at
Tue Sep 1 09:37:20 CEST 2015


Sailaja Mahendrakar <smahendrakar <at> rgbnetworks.com> writes:

> Please find attached the patch for ExtraData computation for 
> aac in -acodec copy.  With audio codec copy, there is no 
> extradata computation and RTMP fails with no audio in playback.

I don't know if it is acceptable what the patch does, so 
please wait for a review from an api expert, but before 
the patch can be applied, please fix the style to make it 
similar to the rest of the file:

> +    if(avctx->extradata_size == 2)
> +    {

This should be on one line, same below (and for "else").

> if((avctx->sample_rate>>1) == a)

Most people here find it much more readable with spaces 
but without the extra parenthesis, as in:
if (avctx->sample_rate >> 1 == a)

> +            temp = 0x48;
> +            put_bits(&pb, 8, temp);                        // 5th Byte

Imo, this gets much more readable without the temp 
variable.

> +       avctx->extradata = av_mallocz(avctx->extradata_size);

Needs a check for OOM.

> +          av_log(NULL

The context should not be NULL.

Carl Eugen



More information about the ffmpeg-devel mailing list