[FFmpeg-cvslog] avcodec/snowenc: Do not write into const AVFrame

Michael Niedermayer git at videolan.org
Sun Sep 20 23:40:51 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Sep 20 22:55:15 2015 +0200| [01770bfda02a72dc4c721e5cbd66ffa47b37002d] | committer: Michael Niedermayer

avcodec/snowenc: Do not write into const AVFrame

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/snowenc.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 99d8889..1f22ad5 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -1557,7 +1557,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 {
     SnowContext *s = avctx->priv_data;
     RangeCoder * const c= &s->c;
-    AVFrame *pic = pict;
+    AVFrame *pic;
     const int width= s->avctx->width;
     const int height= s->avctx->height;
     int level, orientation, plane_index, i, y, ret;
@@ -1584,6 +1584,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
     }
     emms_c();
+    pic = s->input_picture;
+    pic->pict_type = pict->pict_type;
+    pic->quality = pict->quality;
 
     s->m.picture_number= avctx->frame_number;
     if(avctx->flags&AV_CODEC_FLAG_PASS2){
@@ -1844,8 +1847,8 @@ redo_frame:
     ff_snow_release_buffer(avctx);
 
     s->current_picture->coded_picture_number = avctx->frame_number;
-    s->current_picture->pict_type = pict->pict_type;
-    s->current_picture->quality = pict->quality;
+    s->current_picture->pict_type = pic->pict_type;
+    s->current_picture->quality = pic->quality;
     s->m.frame_bits = 8*(s->c.bytestream - s->c.bytestream_start);
     s->m.p_tex_bits = s->m.frame_bits - s->m.misc_bits - s->m.mv_bits;
     s->m.current_picture.f->display_picture_number =



More information about the ffmpeg-cvslog mailing list