diff mbox

[FFmpeg-devel,3/5] avcodec/hevc_parser: use ff_hevc_uninit_parameter_sets()

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

Commit Message

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

Comments

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

LGTM

thx

[...]
diff mbox

Patch

diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c
index 76176185fa..09a203097b 100644
--- a/libavcodec/hevc_parser.c
+++ b/libavcodec/hevc_parser.c
@@ -356,17 +356,8 @@  static int hevc_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
 static void hevc_parser_close(AVCodecParserContext *s)
 {
     HEVCParserContext *ctx = s->priv_data;
-    int i;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(ctx->ps.vps_list); i++)
-        av_buffer_unref(&ctx->ps.vps_list[i]);
-    for (i = 0; i < FF_ARRAY_ELEMS(ctx->ps.sps_list); i++)
-        av_buffer_unref(&ctx->ps.sps_list[i]);
-    for (i = 0; i < FF_ARRAY_ELEMS(ctx->ps.pps_list); i++)
-        av_buffer_unref(&ctx->ps.pps_list[i]);
-
-    ctx->ps.sps = NULL;
 
+    ff_hevc_uninit_parameter_sets(&ctx->ps);
     ff_h2645_packet_uninit(&ctx->pkt);
     ff_hevc_reset_sei(&ctx->sei);