You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
roqvideodec: use av_frame_copy
CC: libav-stable@libav.org Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
This commit is contained in:
committed by
Vittorio Giovara
parent
9f5d6f460c
commit
9cbae3a7d5
@@ -192,7 +192,7 @@ static int roq_decode_frame(AVCodecContext *avctx,
|
|||||||
const uint8_t *buf = avpkt->data;
|
const uint8_t *buf = avpkt->data;
|
||||||
int buf_size = avpkt->size;
|
int buf_size = avpkt->size;
|
||||||
RoqContext *s = avctx->priv_data;
|
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;
|
int ret;
|
||||||
|
|
||||||
if ((ret = ff_reget_buffer(avctx, s->current_frame)) < 0) {
|
if ((ret = ff_reget_buffer(avctx, s->current_frame)) < 0) {
|
||||||
@@ -200,10 +200,11 @@ static int roq_decode_frame(AVCodecContext *avctx,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(copy)
|
if (copy) {
|
||||||
av_image_copy(s->current_frame->data, s->current_frame->linesize,
|
ret = av_frame_copy(s->current_frame, s->last_frame);
|
||||||
s->last_frame->data, s->last_frame->linesize,
|
if (ret < 0)
|
||||||
avctx->pix_fmt, avctx->width, avctx->height);
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
bytestream2_init(&s->gb, buf, buf_size);
|
bytestream2_init(&s->gb, buf, buf_size);
|
||||||
roqvideo_decode_frame(s);
|
roqvideo_decode_frame(s);
|
||||||
|
Reference in New Issue
Block a user