From patchwork Mon Nov 14 15:13:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 39272 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp2487707pzb; Mon, 14 Nov 2022 07:14:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf6b4XJLYtzeYOs9o/fFOSoSmdaY+IFavyRn/7Av4I4sXfRW9VyZYFXfrKAW9h5NearNh7tV X-Received: by 2002:a17:906:d9b:b0:7ae:acea:fca6 with SMTP id m27-20020a1709060d9b00b007aeaceafca6mr10739972eji.150.1668438873397; Mon, 14 Nov 2022 07:14:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668438873; cv=none; d=google.com; s=arc-20160816; b=Cz8oCPW0UR9TyUE4eroMUv7njexV9PXclK66ARTYUeLMrNBHFxcZ6moLN8QvCKudWz SuVndWLmlZqFaoNdAtN0wbGA+D+To4Rh3lSTqe8cVSLONLXt7OxfY0llmor2qLqnPI4O xwvl2ADvfjweWvlifDKr8kMRLjdHxkG24/B8yreKB7a7wt9ACx+lA72/+4Oo3EGkJhtT Pk4gs8Lgozhsdb6PQepDJKPnTsKQ/toHYNS7CPw/N6n0s7eNkcLHnBUlKdzUTBNmNSfn YvQggsVt0drJaQMkN/8uPeqvaChw5IY3Uqf0CXdXHnsXvpDfn9PA6LZephMRcuQj7Oxl aScQ== 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:message-id:date:to:from :delivered-to; bh=czILdh/59YFqnxN617daqXzp2YsO09FghjmXabO94AU=; b=L7+nFTM04stAyot+xO1DO/LY03FKZ3RxQplYNlzVE1u4m613xnWCDZoVYWLUboFs/z /7POHfCBy/d2LeH0jQazR/Suaib36H0sg7mcICubfBX0FSGrUFaXP0Wnb769dkT9vimt en2pgBqkInH65cy4C94uOvjqDM75Q2R/lPZ5Y63mB0NoMRn46EdPc4Nxx4XbHYmfGKe/ u4ADXYkLfkPbw4AKLuJAbhRNbj0VkMZSRX/GfeKbNs2lEuDF9oTOZh57ugAwVKXG5SVo Mtk1CjcgfCrRgsZjqe+F+AoE9D9CqVi3BuDtz9te1E//m27YZHW2Mg7NVIhre4ikS7kd EhIQ== 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 g16-20020a1709065d1000b0079a9eed8c1bsi9030449ejt.894.2022.11.14.07.14.29; Mon, 14 Nov 2022 07:14:33 -0800 (PST) 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 E379268BE10; Mon, 14 Nov 2022 17:14:26 +0200 (EET) 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 BF9CE68BE0A for ; Mon, 14 Nov 2022 17:14:19 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 80CEE2406CA for ; Mon, 14 Nov 2022 16:14:19 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 9VYGHOEv6vJM for ; Mon, 14 Nov 2022 16:14:18 +0100 (CET) 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 E63EA2400F5 for ; Mon, 14 Nov 2022 16:14:18 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 8EE583A0212 for ; Mon, 14 Nov 2022 16:14:18 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 14 Nov 2022 16:13:43 +0100 Message-Id: <20221114151350.5134-1-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/8] fftools/ffmpeg: simplify ost_iter() 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: y4VmmpX7INlU The inner loop never goes through more than 1 iteration, and so can be replaced by an if(). Found-by: Andreas Rheinhardt --- fftools/ffmpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index e6f6773f6a..0fa2fe8c52 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -612,7 +612,7 @@ static OutputStream *ost_iter(OutputStream *prev) for (; of_idx < nb_output_files; of_idx++) { OutputFile *of = output_files[of_idx]; - for (; ost_idx < of->nb_streams; ost_idx++) + if (ost_idx < of->nb_streams) return of->streams[ost_idx]; ost_idx = 0;