[FFmpeg-cvslog] lavc: call ff_init_buffer_info() from default reget buffer.

Michael Niedermayer git at videolan.org
Wed Jan 18 16:39:34 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jan 18 01:14:01 2012 +0100| [e49780f749b2ce8e229fb8257cd01f60e0661b54] | committer: Michael Niedermayer

lavc: call ff_init_buffer_info() from default reget buffer.

This is needed in case the get_buffer() callback doesnt set
width/height.
Ideally all decoders would make calls through some wraper
to the callbacks and that wraper would call ff_init_buffer_info()
But until thats done, the default reget buffer must call this
itself as it needs the values for the changed size check later.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e49780f749b2ce8e229fb8257cd01f60e0661b54
---

 libavcodec/utils.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 1db3f61..0e3b595 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -608,6 +608,8 @@ int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic){
         s->release_buffer(s, pic);
     }
 
+    ff_init_buffer_info(s, pic);
+
     /* If no picture return a new buffer */
     if(pic->data[0] == NULL) {
         /* We will copy from buffer, so must be readable */
@@ -617,9 +619,6 @@ int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic){
 
     /* If internal buffer type return the same buffer */
     if(pic->type == FF_BUFFER_TYPE_INTERNAL) {
-        if(s->pkt) pic->pkt_pts= s->pkt->pts;
-        else       pic->pkt_pts= AV_NOPTS_VALUE;
-        pic->reordered_opaque= s->reordered_opaque;
         return 0;
     }
 



More information about the ffmpeg-cvslog mailing list