mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-04-11 03:32:39 +00:00
avcodec/wcmv: prevent frame copying when outputting duplicate frames
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
5102999223
commit
343f8d514e
@ -45,7 +45,7 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
{
|
{
|
||||||
WCMVContext *s = avctx->priv_data;
|
WCMVContext *s = avctx->priv_data;
|
||||||
AVFrame *frame = data;
|
AVFrame *frame = data;
|
||||||
int skip, blocks, zret, ret, intra = 0, bpp = s->bpp;
|
int skip, blocks, zret, ret, intra = 0, flags = 0, bpp = s->bpp;
|
||||||
GetByteContext gb;
|
GetByteContext gb;
|
||||||
uint8_t *dst;
|
uint8_t *dst;
|
||||||
|
|
||||||
@ -56,11 +56,13 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bytestream2_init(&gb, avpkt->data, avpkt->size);
|
bytestream2_init(&gb, avpkt->data, avpkt->size);
|
||||||
|
blocks = bytestream2_get_le16(&gb);
|
||||||
|
if (!blocks)
|
||||||
|
flags |= FF_REGET_BUFFER_FLAG_READONLY;
|
||||||
|
|
||||||
if ((ret = ff_reget_buffer(avctx, s->prev_frame, 0)) < 0)
|
if ((ret = ff_reget_buffer(avctx, s->prev_frame, flags)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
blocks = bytestream2_get_le16(&gb);
|
|
||||||
if (blocks > 5) {
|
if (blocks > 5) {
|
||||||
GetByteContext bgb;
|
GetByteContext bgb;
|
||||||
int x = 0, size;
|
int x = 0, size;
|
||||||
|
Loading…
Reference in New Issue
Block a user