From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 850664636F for ; Thu, 15 Jun 2023 15:19:48 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 14AD068C552; Thu, 15 Jun 2023 18:19:08 +0300 (EEST) Received: from mail-oa1-f49.google.com (mail-oa1-f49.google.com [209.85.160.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8DED768C54C for ; Thu, 15 Jun 2023 18:19:06 +0300 (EEST) Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-1a83bfe7ca0so1534720fac.0 for ; Thu, 15 Jun 2023 08:19:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686842344; x=1689434344; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xVcqnDwSe3UmSP3uWiYV6CmNhutM2JFUpkKr43a82B8=; b=X/1OWoXfMMLLaMR0FNJPxQhrErMhtWCWsTHVsKlnzhh/lCNRuWGAwrsNCmXEdUdXSe Xd7Wx+fVw1I1uw+I2Ku+oz/5WCq3eJ9oc5wDUMlDO/+Ol4aQgkdLI/gMCEd8UBMJa7ST f9F2dHqSxnHLdgG7LZZkyolFkZrBt9G3Zbin5vJ1w93b53uKIl13J5pqJGKuVpOzvCvK fjtStLORcMaMEhxHlx5dAsd/nZfwi+DVq6A+fWqwKr3tW9tZr4w+6CpnihLA/iUDYOGG MbDxhe+y/bZsNDLrdTqnuuxhsuqqXHBa4edDZ177iYZODHrHg0tzGinDkYUzSrI+0oyY L8lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686842344; x=1689434344; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xVcqnDwSe3UmSP3uWiYV6CmNhutM2JFUpkKr43a82B8=; b=cGhZRz9vgBmRmXNy2svIZyZL3LB5Kpz9fbhfiZuHgxCLl1ceddMqpp/rVIDzT7Bv2t 0jIRg+W2QekgvnY5XNAfZKUzCOP3a9mupHjp9eAHqTDxztToD80GmBNKeGw33TXJmWTf zVa1NqMsbPS/pNf18YUr0eu69okY2nmWxsNivGvMEpPck9acTCpnB6r/6t4vV883BBHn 8cwvdSRDKqUI/C5Vvzm/u36KW1PvKlNT/2FM/LfCsngdsGzShD6tQMpzxp0mi8pKUNNy KgZbLZx7otEcZ+xXKMLUQd6gOFb8YU3yG7QI2PMV3tkfhmUWS244UaZ1oEN9HfD0/FAp yHDQ== X-Gm-Message-State: AC+VfDzOG7IFpQroymJT34pZnkSKJzSYRtBhH8R2RR136Qa5pRklwzeD x6JsBERP10dzqzIqEOKwZRQ6E3d0V7M= X-Google-Smtp-Source: ACHHUZ6Gr68YCFxgUnH/m/GkHyLRWy4s52QNvTeJOr9Di+0O+nD9I0tBNNDfiblRN4zcw86X6M0rJA== X-Received: by 2002:a05:6870:3845:b0:19f:add7:2cd4 with SMTP id z5-20020a056870384500b0019fadd72cd4mr13601454oal.32.1686842344402; Thu, 15 Jun 2023 08:19:04 -0700 (PDT) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id ve17-20020a0568710c1100b001a6a3f99691sm4748405oab.27.2023.06.15.08.19.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 08:19:04 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Thu, 15 Jun 2023 12:18:33 -0300 Message-ID: <20230615151836.50535-9-jamrial@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230615151836.50535-1-jamrial@gmail.com> References: <20230615151836.50535-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 09/11] avcodec/evc_parse: make freeing EVCParserContext buffers a shared function X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: James Almer --- libavcodec/evc_parse.c | 7 +++++++ libavcodec/evc_parse.h | 2 ++ libavcodec/evc_parser.c | 11 +---------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libavcodec/evc_parse.c b/libavcodec/evc_parse.c index 4b9d820d34..703529e9f4 100644 --- a/libavcodec/evc_parse.c +++ b/libavcodec/evc_parse.c @@ -765,3 +765,10 @@ int ff_evc_parse_nal_unit(EVCParserContext *ctx, const uint8_t *buf, int buf_siz return 0; } +void ff_evc_parse_free(EVCParserContext *ctx) { + for (int i = 0; i < EVC_MAX_SPS_COUNT; i++) + av_freep(&ctx->sps[i]); + + for (int i = 0; i < EVC_MAX_PPS_COUNT; i++) + av_freep(&ctx->pps[i]); +} diff --git a/libavcodec/evc_parse.h b/libavcodec/evc_parse.h index 1c1b8ec093..9eabc2f7a4 100644 --- a/libavcodec/evc_parse.h +++ b/libavcodec/evc_parse.h @@ -350,4 +350,6 @@ EVCParserPPS *ff_evc_parse_pps(EVCParserContext *ctx, const uint8_t *bs, int bs_ int ff_evc_parse_nal_unit(EVCParserContext *ctx, const uint8_t *buf, int buf_size, void *logctx); +void ff_evc_parse_free(EVCParserContext *ctx); + #endif /* AVCODEC_EVC_PARSE_H */ diff --git a/libavcodec/evc_parser.c b/libavcodec/evc_parser.c index 072fe41bf1..c85b8f89e7 100644 --- a/libavcodec/evc_parser.c +++ b/libavcodec/evc_parser.c @@ -202,16 +202,7 @@ static void evc_parser_close(AVCodecParserContext *s) { EVCParserContext *ctx = s->priv_data; - for(int i = 0; i < EVC_MAX_SPS_COUNT; i++) { - EVCParserSPS *sps = ctx->sps[i]; - av_freep(&sps); - } - - for(int i = 0; i < EVC_MAX_PPS_COUNT; i++) { - EVCParserPPS *pps = ctx->pps[i]; - - av_freep(&pps); - } + ff_evc_parse_free(ctx); } const AVCodecParser ff_evc_parser = { -- 2.41.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".