[FFmpeg-devel] [libav-devel] [PATCH] qpeg: use reget_buffer() in decode_frame()

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Apr 27 22:59:51 CEST 2011


On Wed, Apr 27, 2011 at 02:39:28PM +0000, Ronald S. Bultje wrote:
> Hi,
> 
> On Wed, Apr 27, 2011 at 10:52 AM, Stefano Sabatini
> <stefano.sabatini-lala at poste.it> wrote:
> > On date Tuesday 2011-04-26 19:20:46 +0200, Reimar Döffinger encoded:
> >> On Tue, Apr 26, 2011 at 11:53:25AM +0200, Stefano Sabatini wrote:
> >> > Also remove unnecessary call to avctx->release_buffer(). reget_buffer
> >> > is required since apparently the coded needs to be passed the previous
> >> > frame data again.
> >>
> >> If that is correct
> >>
> >> >      p->reference= 0;
> >> > -    if(avctx->get_buffer(avctx, p) < 0){
> >> > -        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
> >> > +    if (avctx->reget_buffer(avctx, p) < 0) {
> >>
> >> This can't work.
> >> Setting reference=0 means (I think) e.g. it is ok for libavfilter to
> >> just draw an OSD directly on the frame instead of making a copy.
> >> Or to say it differently: Always using reference = 0 and reget_buffer together
> >> make no sense.
> >
> > So may naive fix is: force reference to 1, so application/libavfilter
> 
> That is incorrect. reference=1 means only the top field is referenced.
> You need to set reference=3. (Not that it matters, but just to be
> correct.)

There's obviously a lot of codecs that need fixing in that regard,
at least all recently changed to reget_buffer.
Obvious question is what that reference=0 is there, I naively
would assume that someone had a reason. I guess I'm most likely
wrong though.


More information about the ffmpeg-devel mailing list