ffmpeg | branch: master | James Almer <jamr...@gmail.com> | Thu Jan  2 12:10:19 
2025 -0300| [5cd49e1bfd049170c37ff907523bf177fe70fee2] | committer: James Almer

avcodec/hevc/hevcdec: use av_frame_side_data_add() where useful

Signed-off-by: James Almer <jamr...@gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5cd49e1bfd049170c37ff907523bf177fe70fee2
---

 libavcodec/hevc/hevcdec.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 4fc48c28a7..3655ed0039 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -3095,14 +3095,11 @@ static int set_side_data(HEVCContext *s)
         return ret;
 
     if (s->sei.common.dynamic_hdr_vivid.info) {
-        AVBufferRef *info_ref = 
av_buffer_ref(s->sei.common.dynamic_hdr_vivid.info);
-        if (!info_ref)
-            return AVERROR(ENOMEM);
-
-        if (!av_frame_new_side_data_from_buf(out, 
AV_FRAME_DATA_DYNAMIC_HDR_VIVID, info_ref)) {
-            av_buffer_unref(&info_ref);
+        if (!av_frame_side_data_add(&out->side_data, &out->nb_side_data,
+                                    AV_FRAME_DATA_DYNAMIC_HDR_VIVID,
+                                    &s->sei.common.dynamic_hdr_vivid.info,
+                                    AV_FRAME_SIDE_DATA_FLAG_NEW_REF))
             return AVERROR(ENOMEM);
-        }
     }
 
     return 0;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to