From patchwork Fri Jan 27 14:29:30 2023 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: 40145 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3ca3:b0:b9:1511:ac2c with SMTP id b35csp1391906pzj; Fri, 27 Jan 2023 06:30:08 -0800 (PST) X-Google-Smtp-Source: AK7set/Tm4ALzC6k+7rti94W3pphCsV0dKbNvVBq5uNhyvs1GKlJvr4/Y87mXx8BW8y3cThVKTDJ X-Received: by 2002:a05:6402:510d:b0:4a0:b601:4a74 with SMTP id m13-20020a056402510d00b004a0b6014a74mr11949568edd.28.1674829808742; Fri, 27 Jan 2023 06:30:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674829808; cv=none; d=google.com; s=arc-20160816; b=1LVFLGiSZhZmWmJxki21/TfUZc/y8RvLlayZZQ+pX13SDjzKEFBTS1w7DNki3WNOze ur/9P9BArd7sPeNv2+8IHBnW1ne/eOjLhV9twjw8a4vXimguFTgrHrgZiWidoQ6FWAca O1FIlWxGWXBu/7KyRQ88l7UGxelmlshhhFJXaRW6S40bj0ynAG8+Vva0MN4xSfQJhVIX L5GHbQn0aPQNPc/Ywh3WDCBtg8n4EHKl20L8BcjubMM4VwQU0J8R9vDkCHnwsRHvtnat 1DwdeOTC8sZtQ80fr77qJaNOqvUsAWqJHBh7sFJVJXglWyiBa72ILAspOw1Ls0yg0hUg 6Buw== 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=VaSGvQJopkow+cx3EGMq9q/zLvaVmTt7sW+XL2oUCGo=; b=I2SSOD341vKzPkkS1WkHFPnYL4f4yyTgdUBC2Bwlsu8jbg2LxpGyMRuQoQn9JDhuFD JpFug6/yX4zU3c62O8WZojmWa5NeHUHO01F7+8LGGShXxtzDhW6eno/GbMqLS1072Wt2 B5Zu4DiAHOQcaYeaFQKXc4DBdXrv6fmUbDwoku0DuH6k5yYsRAxisopXYEnFvz/yIThM WqVwDTIE4RD2jfgDLWpeNTYVd+hTmLZ486VZeQhZd+7LoVdxwn6nEK/w6y77JcRt2Hir Z3xemrHY4ITIv2MwC5s91agCHCJO+zd9zOLnWcmJ00H2823grZuaGzzLJC/rsLa39Qt8 QYbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=LcolpVNT; 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 h13-20020a056402280d00b0049d221b4b39si7358600ede.187.2023.01.27.06.30.08; Fri, 27 Jan 2023 06:30:08 -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=LcolpVNT; 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 B6FAB68BE30; Fri, 27 Jan 2023 16:29:49 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6A30868AD5C for ; Fri, 27 Jan 2023 16:29:42 +0200 (EET) Received: by mail-ed1-f44.google.com with SMTP id v10so4873477edi.8 for ; Fri, 27 Jan 2023 06:29:42 -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=thSr2N0jyVSRoJYbfuG6HD6+JkKrYrlt2WG8ymhuc2w=; b=LcolpVNTrhbbWqTRbM6p1lO/sIBuTD/T/iYCNen9LCIhjaP3khoxYOzwOqdMkfkzAl 1V54BaWFFwtJmkZ/qMvdzZ3Vn4aukoRKpkWKMqo1zEqjvdKLUEwpXgBtdN5v86T2bc4G uSsxztVWKzFrucNQH3C+koHy6z8tVqdqbCbkUhkY7K2afiR+xQxFp27XRrx2wbxp/PDr 92Ypi4yHfDs8vofhuVPtXThJlRVLi3Ber9ePoiDwEO7Rj9ROPfRJRX3gdXZJtW3oi9N7 I3CEJ5YuTjkVo8pfqXd6wFyMeRValb852Bg8Av9Dw2ZZbyu4XBC/SdFXLZ1qSMGOebix lDgw== 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=thSr2N0jyVSRoJYbfuG6HD6+JkKrYrlt2WG8ymhuc2w=; b=ZKi8gY16ZdzPeL+lxluJI1c61FP4FDMfT7nfM/vtpX8GzyZRrBxpn3LjujS7Pgi1Cz 2lfzyht87VxWBDaKFxTOvPMfzxLW/5kDUAwv49hMhnzxsBqEGEKulh54bMZOJ2yOYxu0 7E4mmtEjsv22e2fz1wwSXzYCtY5n2hl0bkUjAn1whSw2NL668625tMwQFYXIxB+UBVt1 S5v9A7YZ5YzkHNHbk+uAEjRfdOBK/LZysmfs5VUyUX3dzVvkgrFgvIC9LKiIollW3hE5 NhAAJrpdGZ1GZL+JRkxXu/nFuRho0Wf1X451324YWI7t7DeOZFJp/rGl8MnhXCSCWzKN k+Yw== X-Gm-Message-State: AFqh2kr68pXYNv2vRnwgv5Zl+GV6S9HMC+SxDPd99w4BVPIUrk4Hutze rxV9zwjhhWq17REFETyGM1+cP9zLJ10= X-Received: by 2002:a05:6402:360d:b0:46c:2c94:d30b with SMTP id el13-20020a056402360d00b0046c2c94d30bmr48095382edb.33.1674829781831; Fri, 27 Jan 2023 06:29:41 -0800 (PST) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id cm20-20020a170907939400b00871cb1b8f63sm2326387ejc.26.2023.01.27.06.29.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 06:29:40 -0800 (PST) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Fri, 27 Jan 2023 16:29:30 +0200 Message-Id: <20230127142931.35061-3-jeebjp@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230127142931.35061-1-jeebjp@gmail.com> References: <20230127142931.35061-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v7 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: M/ceMiQZZHYF 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 1a062f3863..35af565015 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -2244,8 +2244,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) @@ -2276,6 +2274,8 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output, return ret; } + ist->frames_decoded++; + return process_subtitle(ist, &subtitle, got_output); }