diff mbox series

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

Message ID 20240912005925.10151-9-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,01/10,v4] avutil/frame: add an LCEVC enhancement data payload side data type | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer Sept. 12, 2024, 12:59 a.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/hevc/refs.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

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)