summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-10-23 15:24:11 +0200
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-10-26 12:55:40 +0100
commit9cbae3a7d57bd2b862c37fd8123bd1fba680e801 (patch)
treedfaea6e32b1e56ef04175e07b66eb7324fdea257
parent9f5d6f460ceeda8b4ac29b3249a49e275b64c706 (diff)
downloadffmpeg-streaming-9cbae3a7d57bd2b862c37fd8123bd1fba680e801.zip
ffmpeg-streaming-9cbae3a7d57bd2b862c37fd8123bd1fba680e801.tar.gz
roqvideodec: use av_frame_copy
CC: libav-stable@libav.org Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
-rw-r--r--libavcodec/roqvideodec.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c
index acdae75..f7b32f5 100644
--- a/libavcodec/roqvideodec.c
+++ b/libavcodec/roqvideodec.c
@@ -192,7 +192,7 @@ 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) {
@@ -200,10 +200,11 @@ static int roq_decode_frame(AVCodecContext *avctx,
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) {
+ ret = av_frame_copy(s->current_frame, s->last_frame);
+ if (ret < 0)
+ return ret;
+ }
bytestream2_init(&s->gb, buf, buf_size);
roqvideo_decode_frame(s);
OpenPOWER on IntegriCloud