[FFmpeg-devel] [PATCH] lavc: add ff_bprint_to_extradata() helper and use it.
Clément Bœsch
ubitux at gmail.com
Sun Dec 30 22:25:32 CET 2012
On Sun, Dec 30, 2012 at 02:52:08PM +0100, Nicolas George wrote:
[...]
> > +int ff_bprint_to_extradata(AVCodecContext *avctx, AVBPrint *buf)
> > +{
> > + int ret;
> > + char *str;
> > +
> > + ret = av_bprint_finalize(buf, &str);
> > + if (ret < 0)
> > + return ret;
>
> > + avctx->extradata = str;
>
> avctx->extradata is supposed to be padded to FF_INPUT_BUFFER_PADDING_SIZE,
> IIRC.
>
> > + /* extradata needs to contain '\0' in case it is copied around */
> > + avctx->extradata_size = buf->len + 1;
>
> For the codecs I know (at least ASS- and dvdsub-in-Matroska), the
> terminating NUL is not part of the extradata, and therefore the +1 is wrong.
> If you know codecs where the terminating NUL should be included, a flag is
> probably the answer.
>
Forgot to comment that part (the most important one obviously): yes you
are right, I fixed a few other related things and pushed. Thanks!
[...]
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121230/043380ce/attachment.asc>
More information about the ffmpeg-devel
mailing list