diff options
author | Niklas Haas <git@haasn.dev> | 2024-02-19 12:55:51 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-03-04 14:03:17 +0100 |
commit | 16a72983011c2048c6976837b379eb9184b5289a (patch) | |
tree | 2cfab85e3bad20a2947b97612361624f5b11e9d0 | |
parent | 8e485ce9d81eef9647fdc30b375d2c085e1ed59c (diff) |
avcodec/hevcdec: switch to ff_frame_new_side_data_from_buf
For consistency, even though this cannot be overriden at the packet
level.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r-- | libavcodec/hevcdec.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 76aa6b4588..a6b124dd2a 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -2825,11 +2825,9 @@ static int set_side_data(HEVCContext *s) } if (s->rpu_buf) { - AVFrameSideData *rpu = av_frame_new_side_data_from_buf(out, AV_FRAME_DATA_DOVI_RPU_BUFFER, s->rpu_buf); - if (!rpu) - return AVERROR(ENOMEM); - - s->rpu_buf = NULL; + ret = ff_frame_new_side_data_from_buf(s->avctx, out, AV_FRAME_DATA_DOVI_RPU_BUFFER, &s->rpu_buf, NULL); + if (ret < 0) + return ret; } if ((ret = ff_dovi_attach_side_data(&s->dovi_ctx, out)) < 0) @@ -2840,10 +2838,9 @@ static int set_side_data(HEVCContext *s) 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); - return AVERROR(ENOMEM); - } + ret = ff_frame_new_side_data_from_buf(s->avctx, out, AV_FRAME_DATA_DYNAMIC_HDR_VIVID, &info_ref, NULL); + if (ret < 0) + return ret; } return 0; |