Browse code

avcodec/hevc_parser: use ff_hevc_uninit_parameter_sets()

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 2159d4bbc3e69d04242e87bac13ebea8b942d94d)

James Almer authored on 2018/01/21 04:55:00
Showing 1 changed files
... ...
@@ -359,17 +359,8 @@ static int hevc_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
359 359
 static void hevc_parser_close(AVCodecParserContext *s)
360 360
 {
361 361
     HEVCParserContext *ctx = s->priv_data;
362
-    int i;
363
-
364
-    for (i = 0; i < FF_ARRAY_ELEMS(ctx->ps.vps_list); i++)
365
-        av_buffer_unref(&ctx->ps.vps_list[i]);
366
-    for (i = 0; i < FF_ARRAY_ELEMS(ctx->ps.sps_list); i++)
367
-        av_buffer_unref(&ctx->ps.sps_list[i]);
368
-    for (i = 0; i < FF_ARRAY_ELEMS(ctx->ps.pps_list); i++)
369
-        av_buffer_unref(&ctx->ps.pps_list[i]);
370
-
371
-    ctx->ps.sps = NULL;
372 362
 
363
+    ff_hevc_ps_uninit(&ctx->ps);
373 364
     ff_h2645_packet_uninit(&ctx->pkt);
374 365
     ff_hevc_reset_sei(&ctx->sei);
375 366