[FFmpeg-devel] [PATCH] libavcodec/utils: Simplify get_buffer compatibility wrapper.

wm4 nfxjfg at googlemail.com
Mon Feb 17 00:22:37 CET 2014

On Mon, 17 Feb 2014 00:16:14 +0100
Reimar Döffinger <Reimar.Doeffinger at gmx.de> wrote:

> On Sun, Feb 16, 2014 at 11:57:23PM +0100, wm4 wrote:
> > This is probably not legal. Code can assume that it can access the
> > whole referenced buffer, not just where the plane data is. Look for
> > example what vf_pad.c does: it tries to use "unused" space in the
> > buffer data area to extend the planes without copy. But I'm not sure if
> > I read this code right.
> So by my current understanding, to _actually_ be backwards compatible,
> the utils.c code would have to generate one refbuffer _per line_, not
> per plane.
> That is obviously quite insane...

Did the old API really guarantee not to write padding? I don't know
much about the decoders, but usually ffmpeg likes stomping over padding
so much, even very small data like extradata has FF_INPUT_PADDING.

Anyway, I think the emulation will work fine in most cases, as long as
you don't pass refcounted frames to e.g. libavfilter - which you can't
anyway, unless you explicitly enable libavcodec refcounting.

More information about the ffmpeg-devel mailing list