aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/hevc/ps.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-05-31 09:53:28 +0200
committerAnton Khirnov <anton@khirnov.net>2024-06-11 17:39:34 +0200
commitc879165b393dee62ecd7c3b51d0e15964425bf5d (patch)
tree6735f069213b4998de98068eeb794f8c18a6666a /libavcodec/hevc/ps.c
parente12fd62d1dd4a8f129f33015e22e270e871fc4ce (diff)
downloadffmpeg-c879165b393dee62ecd7c3b51d0e15964425bf5d.tar.gz
lavc/hevc_ps: make PPS hold a reference to its SPS
PPS depends on, and is parsed for, specific SPS data. This will be useful in following commits.
Diffstat (limited to 'libavcodec/hevc/ps.c')
-rw-r--r--libavcodec/hevc/ps.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/hevc/ps.c b/libavcodec/hevc/ps.c
index 2dd4f834a4..98217e337b 100644
--- a/libavcodec/hevc/ps.c
+++ b/libavcodec/hevc/ps.c
@@ -1363,6 +1363,8 @@ static void hevc_pps_free(FFRefStructOpaque unused, void *obj)
{
HEVCPPS *pps = obj;
+ ff_refstruct_unref(&pps->sps);
+
av_freep(&pps->column_width);
av_freep(&pps->row_height);
av_freep(&pps->col_bd);
@@ -1828,6 +1830,8 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx,
sps = ps->sps_list[pps->sps_id];
vps = ps->vps_list[sps->vps_id];
+ pps->sps = ff_refstruct_ref_c(sps);
+
pps->dependent_slice_segments_enabled_flag = get_bits1(gb);
pps->output_flag_present_flag = get_bits1(gb);
pps->num_extra_slice_header_bits = get_bits(gb, 3);