From patchwork Tue Sep 19 19:10:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 43790 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a886:b0:149:dfde:5c0a with SMTP id ca6csp168882pzb; Tue, 19 Sep 2023 12:21:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTwqvNHgcj0weRo8zvnJ9ipTq0RWVngn8Ticn3ezpTS38ZlkbdaqNBY6+HFvmFc/0sX2Ln X-Received: by 2002:aa7:dcc1:0:b0:52c:92e3:1d12 with SMTP id w1-20020aa7dcc1000000b0052c92e31d12mr334438edu.11.1695151308654; Tue, 19 Sep 2023 12:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695151308; cv=none; d=google.com; s=arc-20160816; b=Kn4UsrOg2UpiulKIcdnGdJh/Qdiv77Jt/uZjYj6507+pcBnTji+GWVBrVe6790b4wF 2R2Uab+Ufhif2qE+lHLZZqYboJCtB+6Wrzecs6h8xvEoZHGdv6+qtipDsJpi28cyZbOi UoVDuNK9DXj919hANSTBJmUM+9Y/85Y7RW2uaSbqvjeKrCJ2jCEOW0BIiT0O399nAtHn pFOieeh/zIuZoAI5V4WCxryhwBjl0b3aL+Fihvz+NjPhTT2jeisO4E5ng2nNKl5atCk4 9f9nKVWl40MmpgZxkwnqd9UuXccZhjJhBHBaZCtDEu5whn6+YVbB2zdR0lwAcQCwpjxy CYVQ== 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=wfsfz+Ig13HVRhoXs2jffPsgIgp9GHwKI0YbQhitWfcyNoJ7jOt075YD1x5gHdgM6J fb/OEz0NCBkRbqIh7y6cj39kDIHqdoDzSQRtziWseEFhM6zNIL+OtkoR/tFIq5WyosP+ +EzO+wWu2999ol4DHiDvtOmpwu+wqXX27IwYaXWeR6y0ECAbD9XTsgTl/tLF9Eau/rCv ptFkeOLGDWmogKxLOUloY4+JjSIJ7NUe71m++vT9scUJT2JCWfmK8i3CJt5NvZ8LtrHr Me/E6BPacN8i9VengYvSGjQzfvKAAzs26rBUKyLzCCncOAMF5VM+2lKBWNp+TYEV7Sh0 88tw== 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 c16-20020aa7df10000000b005253f116480si10690095edy.613.2023.09.19.12.21.47; Tue, 19 Sep 2023 12:21:48 -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 3264268C91F; Tue, 19 Sep 2023 22:21:06 +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 4B6A568C923 for ; Tue, 19 Sep 2023 22:20:58 +0300 (EEST) Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id EF9895101 for ; Tue, 19 Sep 2023 21:20:57 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id hNaMuXUWiR98 for ; Tue, 19 Sep 2023 21:20:52 +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 460535116 for ; Tue, 19 Sep 2023 21:20:42 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 38D8C3A1715 for ; Tue, 19 Sep 2023 21:20:42 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 19 Sep 2023 21:10:32 +0200 Message-Id: <20230919191044.18873-6-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919191044.18873-1-anton@khirnov.net> References: <20230919191044.18873-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 05/27] 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: mlgC4RsnH2qf 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;