From patchwork Fri May 5 09:07:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 41489 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dca6:b0:f3:34fa:f187 with SMTP id ky38csp330087pzb; Fri, 5 May 2023 02:09:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6SazRA10SewJT0F1k9fnSiEKguyva5j1ouK6PfvN2okgZsgN+dMZ68sOIuelUPL4H9MA++ X-Received: by 2002:a17:907:3203:b0:94a:8f3a:1a77 with SMTP id xg3-20020a170907320300b0094a8f3a1a77mr529216ejb.8.1683277739795; Fri, 05 May 2023 02:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683277739; cv=none; d=google.com; s=arc-20160816; b=DCBuTm/sEmN2aespZmyk7ASzzfgM+u+zduqt/Vvadg1vo03f9teevfsPP+n1UXxSCC W2iyzhLlvIlfWORB8A092QgmM1wdOvdeU20RVeXb621P56tD78x7UR2YhzrIMdfA/JHb f32F2a+wJ+NISZ4GnM6lYfwZ/vjsc+QvkbYXAWZuFuAwxavygnJHJTc9wSfFqqX4K8bg CUyOE94URZZ9j3WKNnXSFSbK6KKzTIWTdKfRK3CJcw4IEdKXv6Nqxo0B5kcprB99kMEh ZoobeqmDaEMkpiXet587QUa5nuBaRZW5TLIlHtyQiZVJnJyA+tzpMomVPxLd2jx+T1tF iaWg== 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=vNjIlbZCsYIZti52v6VD5Ic4ta6fmGFeksDC4Myx+iU=; b=l3Dt9eblgBTqUloI1mj+XPajOBThncgfhrnR335Lrz4dJOmf4XWzQHM148Vlmf89Ag n1ieYrL5BOJurJpNLDnFZdkikvZT7WOV5bBKs+9J8i5xXKloGVOrN1IUAFqHlPb/9oOF mFHaIf3JpXPFQEr2L48w+K0sDEHymEhnvqlTKaSSemOcbLdKlxZn5E/mV3b9raWNzv6R lJMOUcsKnw5azCF9gsqo9kKjBfUer7DIDlq8cdJbblYDMaVC9gcwGMgMFXjFlZ/OAn1J T6P26JdSVjDkYkgAZ1W+91vg2YHwbBTgJaAQbUul7BV4yVKvkuSL1bZsr3cLQbFffJbD 92dw== 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 bc13-20020a056402204d00b00506af260772si4321809edb.365.2023.05.05.02.08.59; Fri, 05 May 2023 02:08:59 -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 E2B0B68C16F; Fri, 5 May 2023 12:07:46 +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 A434168C139 for ; Fri, 5 May 2023 12:07:36 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id C61E62405EC for ; Fri, 5 May 2023 11:07:33 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id Ikw798Tric3W for ; Fri, 5 May 2023 11:07:33 +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 255BF2405F9 for ; Fri, 5 May 2023 11:07:30 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 169D43A11DB for ; Fri, 5 May 2023 11:07:30 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 May 2023 11:07:22 +0200 Message-Id: <20230505090723.24872-10-anton@khirnov.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505090723.24872-1-anton@khirnov.net> References: <20230505090723.24872-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 10/11] fftools/ffmpeg_filter: use InputFilterPriv.eof instead of InputFile.eof_reached 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: NtyBtC8Z8vSp The two checks using eof_reached are testing whether more input can possibly appear on this filtergraph input. InputFilterPriv.eof is the more authoritative source for this information. --- fftools/ffmpeg_filter.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 634315fa34..aea951a2da 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -1620,7 +1620,6 @@ int fg_transcode_step(FilterGraph *graph, InputStream **best_ist) { int i, ret; int nb_requests, nb_requests_max = 0; - InputFilter *ifilter; InputStream *ist; if (!graph->graph && ifilter_has_all_input_formats(graph)) { @@ -1637,7 +1636,8 @@ int fg_transcode_step(FilterGraph *graph, InputStream **best_ist) if (!graph->graph) { for (int i = 0; i < graph->nb_inputs; i++) { InputFilter *ifilter = graph->inputs[i]; - if (!ifilter->ist->got_output && !input_files[ifilter->ist->file_index]->eof_reached) { + InputFilterPriv *ifp = ifp_from_ifilter(ifilter); + if (!ifilter->ist->got_output && !ifp->eof) { *best_ist = ifilter->ist; return 0; } @@ -1665,10 +1665,11 @@ int fg_transcode_step(FilterGraph *graph, InputStream **best_ist) return ret; for (i = 0; i < graph->nb_inputs; i++) { - ifilter = graph->inputs[i]; + InputFilter *ifilter = graph->inputs[i]; + InputFilterPriv *ifp = ifp_from_ifilter(ifilter); + ist = ifilter->ist; - if (input_files[ist->file_index]->eagain || - input_files[ist->file_index]->eof_reached) + if (input_files[ist->file_index]->eagain || ifp->eof) continue; nb_requests = av_buffersrc_get_nb_failed_requests(ifilter->filter); if (nb_requests > nb_requests_max) {