[FFmpeg-devel] [PATCH 09/10] avcodec/hevc/refs: ensure LCEVC SEI payloads are exported as frame side data before get_buffer() calls

James Almer jamrial at gmail.com
Thu Sep 12 03:59:23 EEST 2024


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/hevc/refs.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/libavcodec/hevc/refs.c b/libavcodec/hevc/refs.c
index 09d759f936..a75153c462 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)
-- 
2.46.0



More information about the ffmpeg-devel mailing list