[FFmpeg-cvslog] roqvideodec: use av_frame_copy

Hendrik Leppkes git at videolan.org
Thu Oct 22 20:24:13 CEST 2015


ffmpeg | branch: master | Hendrik Leppkes <h.leppkes at gmail.com> | Thu Oct 22 20:18:00 2015 +0200| [ef4fbee79df6b3835bef36bbe59bdc7c834676f2] | committer: Hendrik Leppkes

roqvideodec: use av_frame_copy

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

 libavcodec/roqvideodec.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c
index 362e882..c1ff3f1 100644
--- a/libavcodec/roqvideodec.c
+++ b/libavcodec/roqvideodec.c
@@ -204,16 +204,16 @@ static int roq_decode_frame(AVCodecContext *avctx,
     const uint8_t *buf = avpkt->data;
     int buf_size = avpkt->size;
     RoqContext *s = avctx->priv_data;
-    int copy= !s->current_frame->data[0];
+    int copy= !s->current_frame->data[0] && s->last_frame->data[0];
     int ret;
 
     if ((ret = ff_reget_buffer(avctx, s->current_frame)) < 0)
         return ret;
 
-    if(copy)
-        av_image_copy(s->current_frame->data, s->current_frame->linesize,
-                      s->last_frame->data, s->last_frame->linesize,
-                      avctx->pix_fmt, avctx->width, avctx->height);
+    if(copy) {
+        if ((ret = av_frame_copy(s->current_frame, s->last_frame)) < 0)
+            return ret;
+    }
 
     bytestream2_init(&s->gb, buf, buf_size);
     roqvideo_decode_frame(s);



More information about the ffmpeg-cvslog mailing list