[FFmpeg-cvslog] utils: check that parameters havnt changed in reget_buffer()
Michael Niedermayer
git at videolan.org
Sat Jan 14 05:04:09 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jan 11 23:52:55 2012 +0100| [44e191457a1268a8112ec7b35cf18de2957123b3] | committer: Michael Niedermayer
utils: check that parameters havnt changed in reget_buffer()
Fixes Ticket902
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=44e191457a1268a8112ec7b35cf18de2957123b3
---
libavcodec/utils.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 78bc6e7..91c5e43 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -557,6 +557,11 @@ int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic){
assert(s->codec_type == AVMEDIA_TYPE_VIDEO);
+ if (pic->data[0] && (pic->width != s->width || pic->height != s->height || pic->format != s->pix_fmt)) {
+ av_log(s, AV_LOG_WARNING, "Width/height/fmt changing with reget buffer");
+ s->release_buffer(s, pic);
+ }
+
/* If no picture return a new buffer */
if(pic->data[0] == NULL) {
/* We will copy from buffer, so must be readable */
More information about the ffmpeg-cvslog
mailing list