From patchwork Mon Dec 19 07:34:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 39728 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bc95:b0:ad:ade2:bfd2 with SMTP id fx21csp3819165pzb; Sun, 18 Dec 2022 23:34:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf6H4EV6Lcu+8YIkoh6fpbr0Kwyv9jhU8dkwLGtEWAKlZcjd6e7FnguN/gt3Kv1iGQuXxeva X-Received: by 2002:a17:906:3a01:b0:7ad:aed7:a5da with SMTP id z1-20020a1709063a0100b007adaed7a5damr50663408eje.28.1671435281915; Sun, 18 Dec 2022 23:34:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671435281; cv=none; d=google.com; s=arc-20160816; b=cNmQpO224dtymsGWkAbvF+5igaqfgqYv+pp0BsGMbADP+loU9Hm+2ch6o4JLYSNDi3 n4mE6jW/BdF5wlzDLyj//XATs/uuf7HyFP8/vNuxZGrsV8lQYI+TDypI8wx2WAz8/i7p PgZHQyf5oCUsf05QlFCu1nJXCsVbGksIfvAD53j/r3dKuQPqfuBKJZ0FYa6Tc13SOp4t qjSyL3j4Um2TjQVRnvBcIgfhoZBxGbyw2fFqJoG5CfJvrdOmjH9OMPx7EqsBFVM/fYB0 /4FbLNp97uOhC5Mtb/0776iL02CX4MlPGBoJ9NBCXO3PIK+Xu4upVxfKMhoqWqk85gh7 j7pg== 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:dkim-signature:delivered-to; bh=gxE1Z4inxNxg5QL1IyGobKuuKz0QV/xZZKVnI1177/Y=; b=Y2kbp6NHHizSyKksf+26jOINTgmTazLEQImpDm0dsyus5HZmpZn7ttTtMYeb4HYAxQ PWJ4lkz5LEBEpUIKqJCHCuAcY0/m/a5aO6a++WH7YAOkBs3o8oq5S4RnTaaynIPFhbco VhJnh/NT59UepI5QS7qqfKvYcKBI2sxguD/UoiC0PMk5WJMwqwitMMzrCBSqbsnHRGZb AlKjBLHp0tNGhcUnduXNwdaX2Jj2ozs5Dx+IU7sRgXDinzBYStNEzr7/oH2o1UhVbL01 ZT0xyhHgvnTAPp+zwRQvCE0/ebFvZuNketlUkb4m1yzj+l4SNveik/CWaza910Qz5KSm NQhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=dgewsN0a; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ty16-20020a170907c71000b007c0a96378easi7550915ejc.704.2022.12.18.23.34.41; Sun, 18 Dec 2022 23:34:41 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=dgewsN0a; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 60B5D68B3E7; Mon, 19 Dec 2022 09:34:26 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 99DCE68B1F1 for ; Mon, 19 Dec 2022 09:34:18 +0200 (EET) Received: by mail-lf1-f52.google.com with SMTP id b3so12415565lfv.2 for ; Sun, 18 Dec 2022 23:34:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=GEP0D+wR/tbBLZZEgn3HvS7SVm90vZn7SNSMd64TtVc=; b=dgewsN0a0c7ORsgzRsUyDetfY2teZiyROF2w4oOuIXlUmKMR94YuX+zFrZcBpXltHx TKYHZQWQVYwaSTwY7W5Rdd0HAF8lRaxTIi5UvVPNAmvyYnysbYaa+53VZSn4PXcA4D44 RWhLEU+GoLK+lYaQzDLZpOOs19jY903I+kmczrrp4uXlC3Jh9MJDnaJsssr+NnJqCWsb fhtcU0cVrzwtkjFXa5z/5pMJRUEAdazAgVVJkZz/qL9xIgvFxZ8dSlPkHUUFOaaCvnaH fBlwBfT6iEzQr6bBgoQhYVo2IQ1k/Kqhafc/6SolbEkHzsw54ErnP8wiwg7sT/9I/6Os mdRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GEP0D+wR/tbBLZZEgn3HvS7SVm90vZn7SNSMd64TtVc=; b=VNvirGDJk4L65dMhgdMcjGv/NeSGHyDW7xBFyy2G4n/zWzmMlulvWhundEw/Bqp3Fb ar8+7F5RDIDsZihcGVv2mOiCNYuXWZ/n/hJcfnbPdxNMHVpcmHL/ZhGPY3xXAN1vumJf L3dwcTeAedu6ByO+GZaqeGi6E9VT0VXULQlJdGS+cgQBcUeBSMWUArUzRwoxPMSwZuBF TZCFUStYcvd+oNLt0TKaCZ2U152mdGeH2Z/E3tam5vJYyrZJj6zqepfcs4kd3i6Tzz5k DSvQ0AmIrYW1i9IiTu4K/sI6StnvHmE3sW4wJvi50i7yKEryzhdzOmZDSwyZNBCMrvDO 4E5w== X-Gm-Message-State: ANoB5pkLrATjHGhoigO37UvQS9TfH1p9PoyQo4JJ8bhHVYrzNzr90eeI OBGoQdIPqmpijmelnJ8Xy9nG+9brlec= X-Received: by 2002:a05:6512:2344:b0:4b5:a70f:8efc with SMTP id p4-20020a056512234400b004b5a70f8efcmr20632865lfu.64.1671435257922; Sun, 18 Dec 2022 23:34:17 -0800 (PST) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id r7-20020a19ac47000000b004b58ebf0399sm1029165lfc.132.2022.12.18.23.34.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 23:34:17 -0800 (PST) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 19 Dec 2022 09:34:07 +0200 Message-Id: <20221219073408.11501-3-jeebjp@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219073408.11501-1-jeebjp@gmail.com> References: <20221219073408.11501-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v6 2/3] ffmpeg: move decoded frame counter from after post-processing to decode 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: 0RQzQ5aGsSH7 From: Jan Ekström This way we can call process_subtitles without causing the decoded frame counter to get bumped. Additionally, this now takes into mention all of the decoded subtitle frames without fix_sub_duration latency/buffering, or filtering out decoded reset/end subtitles without any rendered rectangles, which matches the original intent in 4754345027eb85cfa51aeb88beec68d7b036c11e . Signed-off-by: Jan Ekström --- fftools/ffmpeg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index eaf0a40328..3b94eaaa58 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -2232,8 +2232,6 @@ static int process_subtitle(InputStream *ist, AVSubtitle *subtitle, int *got_out if (!subtitle->num_rects) goto out; - ist->frames_decoded++; - for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { if (!check_output_constraints(ist, ost) || !ost->enc_ctx || ost->enc_ctx->codec_type != AVMEDIA_TYPE_SUBTITLE) @@ -2264,6 +2262,8 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output, return ret; } + ist->frames_decoded++; + return process_subtitle(ist, &subtitle, got_output); }