[FFmpeg-devel,2/5] avcodec/hevcdec: use ff_hevc_uninit_parameter_sets()

Submitted by James Almer on Jan. 20, 2018, 9:12 p.m.

Details

Message ID 20180120211253.9676-2-jamrial@gmail.com
State New
Headers show

Commit Message

James Almer Jan. 20, 2018, 9:12 p.m.
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/hevcdec.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

Comments

Michael Niedermayer Jan. 21, 2018, 2:35 a.m.
On Sat, Jan 20, 2018 at 06:12:50PM -0300, James Almer wrote:
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavcodec/hevcdec.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)

LGTM

thx

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 4bfae8c12b..98a96defb7 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -3277,15 +3277,7 @@  static av_cold int hevc_decode_free(AVCodecContext *avctx)
         av_frame_free(&s->DPB[i].frame);
     }
 
-    for (i = 0; i < FF_ARRAY_ELEMS(s->ps.vps_list); i++)
-        av_buffer_unref(&s->ps.vps_list[i]);
-    for (i = 0; i < FF_ARRAY_ELEMS(s->ps.sps_list); i++)
-        av_buffer_unref(&s->ps.sps_list[i]);
-    for (i = 0; i < FF_ARRAY_ELEMS(s->ps.pps_list); i++)
-        av_buffer_unref(&s->ps.pps_list[i]);
-    s->ps.sps = NULL;
-    s->ps.pps = NULL;
-    s->ps.vps = NULL;
+    ff_hevc_uninit_parameter_sets(&s->ps);
 
     av_freep(&s->sh.entry_point_offset);
     av_freep(&s->sh.offset);