From patchwork Tue Oct 3 15:35:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 44118 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1204:b0:15d:8365:d4b8 with SMTP id v4csp2140378pzf; Tue, 3 Oct 2023 08:36:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+Yf6p7QOmUnztulFXCEeBX3DFdLkDRJvWWrpHS4yRuX8MxpA+dqhy6X6gBd/m+KaajpW4 X-Received: by 2002:a50:ec93:0:b0:522:b876:9ef5 with SMTP id e19-20020a50ec93000000b00522b8769ef5mr2648555edr.8.1696347374815; Tue, 03 Oct 2023 08:36:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696347374; cv=none; d=google.com; s=arc-20160816; b=DPbB0y7iPmVPlM4o5tDEDv8Y/FgwqwSRHo265izpjBL8nUPE+fUkZumhKTMh3EXanN 3kZKazP2q31PTRwHckzSQKIL7lbWkBX4lxjLnea2BxayZux0cYKr/1bU8XgI8pJ0dc7R OQg1e99+Si6z+L7512uw9/ZlYzGRquTUTWMPWoCSvF/kjiEV2dgxvofr4CZI80cHChM7 eh7Ra2EXdcTja2U/VXPzCaQtmvAsVvsWHAyxbq5sbcFHbwrrAGOdn3pq3I4F9srZekrR z4laWhl1Qu7ckFsSlUYu8GcY8cWj4lSXzje86lWfVEamvmK60pHLAPUoUHELNgAaehqf ZKYA== 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=dPIwRf3TlZlSJ3bUwKtsezpmIrmoIXuKHh7TtTExt2Y=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=afkzfczZQbeOxP3/Dutd6wrBFlYsrgLeB7q7lhERAJSapwSBRQYrzapuBqfYuCzSiX NSHdjta8UNmCmtPq1/K4N40nkdbFpnzZXFEEeuMS22DoxvrrtHpSH9wp3Se0Vk8AMv4G 8z9NZCV6ItyCuH88xWO5mVqBvTo73kxANcDxLhSNpIKEiKIvYCRPanfSGi25wlA3X7m0 lpvEeLiG9ZPDYF/IDKUHZeK7BA6gc7z+HyIXyPNnG4vO23GsZZH3S0YUJV3aZ4KxVCwF HjvCloSFANes6U2J5MaTHaOLL0+hdVbELIJA8cvhjlsEygApEkFtuH1/mApVi27qm3zd HPBg== 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 a19-20020aa7d913000000b005255d8f2d00si709104edr.672.2023.10.03.08.36.14; Tue, 03 Oct 2023 08:36:14 -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 0DF0A68CCDE; Tue, 3 Oct 2023 18:35:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9C7BE68CA5C for ; Tue, 3 Oct 2023 18:35:41 +0300 (EEST) Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 05D175256 for ; Tue, 3 Oct 2023 17:35:41 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id At0_XcPJeIIV for ; Tue, 3 Oct 2023 17:35:40 +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 mail1.khirnov.net (Postfix) with ESMTPS id 18D255216 for ; Tue, 3 Oct 2023 17:35:40 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 178D53A073A for ; Tue, 3 Oct 2023 17:35:33 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 3 Oct 2023 17:35:18 +0200 Message-Id: <20231003153526.19228-4-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231003153526.19228-1-anton@khirnov.net> References: <20231003153526.19228-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 04/12] ffools/ffmpeg_filter: stop trying to handle an unreachable state 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: qzjJQvzZZD6/ ifilter_send_eof() will fail if the input has no real or fallback parameters, so there is no need to handle the case of some inputs being in EOF state yet having no parameters. --- fftools/ffmpeg.c | 2 +- fftools/ffmpeg.h | 2 -- fftools/ffmpeg_filter.c | 10 +++++----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index fd2ce1c2d0..14f55cbec7 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -944,7 +944,7 @@ static int choose_output(OutputStream **post) INT64_MIN : ost->last_mux_dts; } - if (!ost->initialized && !ost->inputs_done && !ost->finished) { + if (!ost->initialized && !ost->finished) { ost_min = ost; break; } diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index b059ecbb9f..2e8f1db9b6 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -583,8 +583,6 @@ typedef struct OutputStream { // parameters are set in the AVStream. int initialized; - int inputs_done; - const char *attachment_filename; int keep_pix_fmt; diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index b6348d7f87..804b9de3dc 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -2076,11 +2076,11 @@ int fg_transcode_step(FilterGraph *graph, InputStream **best_ist) } } - // graph not configured, but all inputs are either initialized or EOF - for (int i = 0; i < graph->nb_outputs; i++) - graph->outputs[i]->ost->inputs_done = 1; - - return 0; + // This state - graph is not configured, but all inputs are either + // initialized or EOF - should be unreachable because sending EOF to a + // filter without even a fallback format should fail + av_assert0(0); + return AVERROR_BUG; } *best_ist = NULL;