[FFmpeg-cvslog] avcodec/hevc/hevcdec: use av_frame_side_data_add() where useful

James Almer git at videolan.org
Fri Jan 10 20:14:48 EET 2025


ffmpeg | branch: master | James Almer <jamrial at 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 <jamrial at 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;



More information about the ffmpeg-cvslog mailing list