[FFmpeg-devel] ogg flac header fix

Måns Rullgård mans
Sun Mar 30 00:09:08 CET 2008


Justin Ruggles <justinruggles at bellsouth.net> writes:

> Hi,
>
> Here is a small patch to fix Ogg/FLAC encoding.  Current code uses the
> wrong size for the first metadata packet.  The fix is pretty obvious,
> but I'm not oggenc.c maintainer, so I thought I would go ahead and post
> it first.
>
> -Justin
>
>
> Index: libavformat/oggenc.c
> ===================================================================
> --- libavformat/oggenc.c	(revision 12624)
> +++ libavformat/oggenc.c	(working copy)
> @@ -88,8 +88,8 @@
>      uint8_t *p;
>      if (extradata_size != 34)
>          return -1;
> -    oggstream->header_len[0] = 79;
> -    oggstream->header[0] = av_mallocz(79); // per ogg flac specs
> +    oggstream->header_len[0] = 51;
> +    oggstream->header[0] = av_mallocz(51); // per ogg flac specs

Seems correct.  The figure 79 is for the entire Ogg page, whereas this
buffer holds just the payload.

I have to say it's a pointless number to mention in the spec, though.
But then again, what else is to expect when dealing with Xiph.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list