summaryrefslogtreecommitdiffstats
path: root/libavcodec/hevc_ps.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-01-20 16:54:15 -0300
committerJames Almer <jamrial@gmail.com>2018-01-21 00:06:30 -0300
commit9462b2b8205397ea5972b2365c2e8db6872ef3e9 (patch)
tree6152f09fdb4858c548b30bf74c30ba80e74a2a72 /libavcodec/hevc_ps.c
parent251f0bcb7be9e42af91c1beb346d752185bbcbb9 (diff)
downloadffmpeg-streaming-9462b2b8205397ea5972b2365c2e8db6872ef3e9.zip
ffmpeg-streaming-9462b2b8205397ea5972b2365c2e8db6872ef3e9.tar.gz
avcodec/hevc_ps: add a function to uninitialize parameter set buffers
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/hevc_ps.c')
-rw-r--r--libavcodec/hevc_ps.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index a4f7ed6..4787312 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -1704,6 +1704,22 @@ err:
return ret;
}
+void ff_hevc_ps_uninit(HEVCParamSets *ps)
+{
+ int i;
+
+ for (i = 0; i < FF_ARRAY_ELEMS(ps->vps_list); i++)
+ av_buffer_unref(&ps->vps_list[i]);
+ for (i = 0; i < FF_ARRAY_ELEMS(ps->sps_list); i++)
+ av_buffer_unref(&ps->sps_list[i]);
+ for (i = 0; i < FF_ARRAY_ELEMS(ps->pps_list); i++)
+ av_buffer_unref(&ps->pps_list[i]);
+
+ ps->sps = NULL;
+ ps->pps = NULL;
+ ps->vps = NULL;
+}
+
int ff_hevc_compute_poc(const HEVCSPS *sps, int pocTid0, int poc_lsb, int nal_unit_type)
{
int max_poc_lsb = 1 << sps->log2_max_poc_lsb;
OpenPOWER on IntegriCloud