diff options
author | James Almer <jamrial@gmail.com> | 2019-08-30 11:37:25 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-09-04 10:07:12 -0300 |
commit | 9ea6d2149e25d68885a24894bb911077b05388c4 (patch) | |
tree | d302ed27dd814bea2189537f62c4120f69ecb669 /libavcodec/flicvideo.c | |
parent | 39f129593756e3e270ed3881ca076627f30e1eb7 (diff) | |
download | ffmpeg-streaming-9ea6d2149e25d68885a24894bb911077b05388c4.zip ffmpeg-streaming-9ea6d2149e25d68885a24894bb911077b05388c4.tar.gz |
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/flicvideo.c')
-rw-r--r-- | libavcodec/flicvideo.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c index bf8ffeb..276c2ff 100644 --- a/libavcodec/flicvideo.c +++ b/libavcodec/flicvideo.c @@ -185,7 +185,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, bytestream2_init(&g2, buf, buf_size); - if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) + if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; pixels = s->frame->data[0]; @@ -519,7 +519,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, bytestream2_init(&g2, buf, buf_size); - if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) + if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; pixels = s->frame->data[0]; @@ -817,7 +817,7 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, bytestream2_init(&g2, buf, buf_size); - if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) + if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; pixels = s->frame->data[0]; |