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

Stefano Sabatini stefano.sabatini-lala at poste.it
Wed Apr 27 12:52:26 CEST 2011


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
will preserve the frame and it can be requested again unmodified via
reget_buffer() (but it's hard to say if the fix is correct without a
more deep knowledge of the codec).

Adding libav-devel to recipients.
-- 
FFmpeg = Friendly Fascinating Mortal Puritan Elfic Gorilla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-qpeg-use-reget_buffer-in-decode_frame.patch
Type: text/x-diff
Size: 1584 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110427/4e798523/attachment.bin>


More information about the ffmpeg-devel mailing list