summaryrefslogtreecommitdiff
path: root/libavcodec/mss4.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-08-30 11:37:25 -0300
committerJames Almer <jamrial@gmail.com>2019-09-04 10:07:12 -0300
commit9ea6d2149e25d68885a24894bb911077b05388c4 (patch)
treed302ed27dd814bea2189537f62c4120f69ecb669 /libavcodec/mss4.c
parent39f129593756e3e270ed3881ca076627f30e1eb7 (diff)
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 <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/mss4.c')
-rw-r--r--libavcodec/mss4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c
index 76c746a2d5..432df294d6 100644
--- a/libavcodec/mss4.c
+++ b/libavcodec/mss4.c
@@ -558,7 +558,7 @@ static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (frame_type != SKIP_FRAME && 8*buf_size < 8*HEADER_SIZE + mb_width*mb_height)
return AVERROR_INVALIDDATA;
- if ((ret = ff_reget_buffer(avctx, c->pic)) < 0)
+ if ((ret = ff_reget_buffer(avctx, c->pic, 0)) < 0)
return ret;
c->pic->key_frame = (frame_type == INTRA_FRAME);
c->pic->pict_type = (frame_type == INTRA_FRAME) ? AV_PICTURE_TYPE_I