[FFmpeg-devel] [PATCH] fix stsd box size for AC3 in MP4

Robert Swain robert.swain
Thu Sep 4 14:05:09 CEST 2008


2008/9/4 Kurtnoise <kurtnoise at free.fr>:
> Hi,
>
> According to the specs, stsd box size should be limited to 216 bytes for
> such streams. However with the current code, this atom is too big.
>
> So, it seems that AC3 codec id is missing in mov_write_audio_tag(). Here is
> a patch to fix this...
>
> ++
> Kurtnoise
>
> Index: libavformat/movenc.c
> ===================================================================
> --- libavformat/movenc.c        (revision 15193)
> +++ libavformat/movenc.c        (working copy)
> @@ -443,13 +443,16 @@
>         track->enc->codec_id == CODEC_ID_AMR_NB ||
>         track->enc->codec_id == CODEC_ID_PCM_S24LE ||
>         track->enc->codec_id == CODEC_ID_PCM_S32LE ||
> +        track->enc->codec_id == CODEC_ID_AC3 ||
>         track->enc->codec_id == CODEC_ID_ALAC))
>         mov_write_wave_tag(pb, track);
>     else if(track->tag == MKTAG('m','p','4','a'))
>         mov_write_esds_tag(pb, track);
>     else if(track->enc->codec_id == CODEC_ID_AMR_NB)
>         mov_write_amr_tag(pb, track);
> -    else if (track->enc->codec_id == CODEC_ID_ALAC)
> +    else if(track->enc->codec_id == CODEC_ID_AC3)
> +        mov_write_ac3_tag(pb, track);
> +    else if(track->enc->codec_id == CODEC_ID_ALAC)
>         mov_write_extradata_tag(pb, track);
>     else if(track->vosLen > 0)
>         mov_write_glbl_tag(pb, track);

This contains a cosmetic change to the ALAC line. If you want to make
that consistent with the other lines, it should be in a separate
patch/commit. :)

Regards,
Rob




More information about the ffmpeg-devel mailing list