From 9ea6d2149e25d68885a24894bb911077b05388c4 Mon Sep 17 00:00:00 2001 From: James Almer Date: Fri, 30 Aug 2019 11:37:25 -0300 Subject: avcodec/decode: add a flags parameter to ff_reget_buffer() Some decoders may not need a writable buffer in some specific cases, but only a reference to the existing buffer with updated frame properties instead, for the purpose of returning duplicate frames. For this, the FF_REGET_BUFFER_FLAG_READONLY flag is added, which will prevent potential allocations and buffer copies when they are not needed. Signed-off-by: James Almer --- libavcodec/truemotion1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavcodec/truemotion1.c') diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c index e1824384c5..bcfe473852 100644 --- a/libavcodec/truemotion1.c +++ b/libavcodec/truemotion1.c @@ -882,7 +882,7 @@ static int truemotion1_decode_frame(AVCodecContext *avctx, if ((ret = truemotion1_decode_header(s)) < 0) return ret; - if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) + if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; if (compression_types[s->compression].algorithm == ALGO_RGB24H) { -- cgit v1.2.3