X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Froqvideodec.c;h=4f778dc98aef5ea545762d32483c4efc6530bbf7;hb=645c6ff4231a75a71db58c8e6d06346068d2f949;hp=ac7d4bafe0efbc94acaf90b5f0a1fdc54578141b;hpb=b2bed9325dbd6be0da1d91ffed3f513c40274fd2;p=ffmpeg diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c index ac7d4bafe0e..4f778dc98ae 100644 --- a/libavcodec/roqvideodec.c +++ b/libavcodec/roqvideodec.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 the ffmpeg project + * Copyright (C) 2003 The FFmpeg project * * This file is part of Libav. * @@ -29,6 +29,8 @@ #include #include +#include "libavutil/imgutils.h" + #include "avcodec.h" #include "bytestream.h" #include "internal.h" @@ -190,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) { @@ -198,9 +200,11 @@ static int roq_decode_frame(AVCodecContext *avctx, return ret; } - if(copy) - av_picture_copy((AVPicture*)s->current_frame, (AVPicture*)s->last_frame, - 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); @@ -234,5 +238,5 @@ AVCodec ff_roq_decoder = { .init = roq_decode_init, .close = roq_decode_end, .decode = roq_decode_frame, - .capabilities = CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_DR1, };