aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-09-09 23:05:22 -0300
committerJames Almer <jamrial@gmail.com>2024-09-23 10:05:34 -0300
commitd250cc02e2502692d3d9ae58780a9caec236ad09 (patch)
tree01af44692df37023465f32bd3dbdbfaf0b4cbf14
parentdbbf9a5ff771e0b77705ad0f75de353a5e593f9b (diff)
downloadffmpeg-d250cc02e2502692d3d9ae58780a9caec236ad09.tar.gz
avcodec/hevc/refs: ensure LCEVC SEI payloads are exported as frame side data before get_buffer() calls
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/hevc/refs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/hevc/refs.c b/libavcodec/hevc/refs.c
index 20fdbb5794..83cf160e07 100644
--- a/libavcodec/hevc/refs.c
+++ b/libavcodec/hevc/refs.c
@@ -86,6 +86,19 @@ static HEVCFrame *alloc_frame(HEVCContext *s, HEVCLayerContext *l)
if (frame->f)
continue;
+ ret = ff_progress_frame_alloc(s->avctx, &frame->tf);
+ if (ret < 0)
+ return NULL;
+
+ // Add LCEVC SEI metadata here, as it's needed in get_buffer()
+ if (s->sei.common.lcevc.info) {
+ HEVCSEILCEVC *lcevc = &s->sei.common.lcevc;
+ ret = ff_frame_new_side_data_from_buf(s->avctx, frame->tf.f,
+ AV_FRAME_DATA_LCEVC, &lcevc->info);
+ if (ret < 0)
+ goto fail;
+ }
+
ret = ff_progress_frame_get_buffer(s->avctx, &frame->tf,
AV_GET_BUFFER_FLAG_REF);
if (ret < 0)