From patchwork Sat Jul 23 14:09:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36904 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1649:b0:8b:613a:194d with SMTP id no9csp1046758pzb; Sat, 23 Jul 2022 07:11:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vfwbPB9zlxG/IfX6rNbOHCBhl2HG/ES0naRVCv4nVH9TMJXqdeo03acLsbdv4mECwWOHfQ X-Received: by 2002:a17:907:7f22:b0:72b:94a2:86b8 with SMTP id qf34-20020a1709077f2200b0072b94a286b8mr3738043ejc.236.1658585469754; Sat, 23 Jul 2022 07:11:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658585469; cv=none; d=google.com; s=arc-20160816; b=iBd4siq0VRMK4j8fzNpctD0ziiu1iQreA9IYmSqfdgBIueePay3oJWG8+/FPQ2hqnh zW9oKwyerTu2yRUx/xKKUMVSLXaSE3kW6sA2OWa/qDqpMcd/TIP7++y/X4e4YyzAdoPP pjc/4Ko5eeCLYkgu17ni1wexdbnm0jasDcNvKoiDN/IvPpKLp9bmDXRniBE5lD7+06ls W90+4SfRG2f16t8k9oze7mTfTToHjnSFW5Xm7gXBedo4odpPFkVpI3HkVq43qYo6NabR laDWkVTtjAy+8aQ6UsFjVlCE2uI9btNVPeFsyw+vOMnOnqizpf3EZa+mE9t3y0iQSHwp GdYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=Ilf3BhbsX2fQXtxfQ97Zdw7U++Fq1h/cp2uxlYHDXt0=; b=cLDjKaxZp2Ac9MiF/1tCWyUbajCNYrOcmgGpCZueZF8rmFkgAyLRBSFWQb8TWnpHWI 6RN9jdpJ7P5SuMzimTjZsrlnlWz7SlG8c1fzugap/h6Xr/Mzg7od6mdt3qyfPT9aLjKv qIYdTu17YccgrhAgO9zWCn41xr+aDsYRxchTxgbqrz2KmhLnfFJdLuchQSiVj/8Fo4oq iuhsGGmuk7loEAZZVy12+QDXpAImoJAq7RZe8DiVwfKxmjGSqsQ4kqpG5fVmBGZRsiVM /vuJXRWMmVNboyqF4YEQwMWJn7yVZ+Uj8jwWig8gnY9pbIQCLqrJqvsGhtXaz6KYYnet IFLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id cr20-20020a170906d55400b007269f7adbadsi10155337ejc.670.2022.07.23.07.11.08; Sat, 23 Jul 2022 07:11:09 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DAFE568B7B8; Sat, 23 Jul 2022 17:10:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9904D68B743 for ; Sat, 23 Jul 2022 17:10:22 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 1C65924017C for ; Sat, 23 Jul 2022 16:10:22 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id vBLdAktDrn9O for ; Sat, 23 Jul 2022 16:10:21 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 67F87240506 for ; Sat, 23 Jul 2022 16:10:19 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id 573CF3A03D8; Sat, 23 Jul 2022 16:10:19 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sat, 23 Jul 2022 16:09:28 +0200 Message-Id: <20220723140952.31814-3-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220723140952.31814-1-anton@khirnov.net> References: <20220723140952.31814-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 03/27] fftools/ffmpeg: remove an unnecessary avcodec_close() call 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: dUMGDvnVPo0/ No encoders can possibly be opened at this point. And even if some were, they would be closed in ffmpeg_cleanup(). --- fftools/ffmpeg.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 7c340f4570..1cf704ab82 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -3344,13 +3344,8 @@ static int transcode_init(void) /* init input streams */ for (i = 0; i < nb_input_streams; i++) - if ((ret = init_input_stream(i, error, sizeof(error))) < 0) { - for (i = 0; i < nb_output_streams; i++) { - ost = output_streams[i]; - avcodec_close(ost->enc_ctx); - } + if ((ret = init_input_stream(i, error, sizeof(error))) < 0) goto dump_format; - } /* * initialize stream copy and subtitle/data streams.