From patchwork Mon Oct 10 12:44:56 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: 38670 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp348591pzb; Mon, 10 Oct 2022 05:45:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4UzB1fnJdd1B8zOoZLYXgksOLK4q0CwxjZq0sisdX/UItWxMBpQRcdxGBt8L2F/coRnjzV X-Received: by 2002:a05:6402:11d1:b0:45c:1fef:ee43 with SMTP id j17-20020a05640211d100b0045c1fefee43mr4449814edw.36.1665405924443; Mon, 10 Oct 2022 05:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665405924; cv=none; d=google.com; s=arc-20160816; b=SgeUiFxnWtk/Nt0HrISGZzHT0taNRNHsoygaXfqtlrSBtSZ+7cHuGd4XVG+hGlY4Um UwoERr/8PVocrh+iwG2ltPf8ig6JpdtSNgVjr/5a7fYYR7zajmRlJUq6Geve/pa7Q7N4 TX9f83/7p2CaJzoSxoJDn/NJKPdGu0rhDLWLq21jOHk71vtbsLnjYDTAWPRd32LfPTjw uOmYDc/fqDb41jmgyIHt0hV2+emCigth3wr5ygbrghzH7j+ZIxlgMbZzAn3MhjdU0iaS Vf+ukjfyoboRlyWNldsu06tEA0z0ppbnn9MeUAEXabOce1UKLXJq80xZB13vKP7axuaR wEnw== 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=Nsn6Jk4qprytNLi1LYbrziiQnPir1UPmVWFh80fdIDM=; b=Pjbe7frMoBOIcGqWR7BofA5u5anxiJALTmzlVCLZ+Vss8E+UcrXq8V8t342QgS7yoX 681Fbzdh4apNgQI882+2d+c9pCZwhaARaeAdWGyxGOmzA+L9Q8rvTZqSUv4g4hCAVJUe od1+YrkxWb9OdU2hd6x55yuz9+h6d02vN0Qu0sqFSUACkp+HciCFiO0G7EaBKzNji7nW sEHbFxPO9G2dRBWCAr968971fYhQE4AEVhFzcQuRyeElY4CUpbJQ0KF9qugQgsRmOJyZ zHorJbPmGoLKkJeggFVIC6RddWgkx/uYR5/pXARL0LhhuwPAQIdWh1svvnbJvqwY8YuE yA1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=DFrNqQa1; 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 he17-20020a1709073d9100b00776d4009294si12054576ejc.651.2022.10.10.05.45.23; Mon, 10 Oct 2022 05:45:24 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=DFrNqQa1; 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 01B0668BC82; Mon, 10 Oct 2022 15:45:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C78E568BC82 for ; Mon, 10 Oct 2022 15:45:04 +0300 (EEST) Received: by mail-lj1-f175.google.com with SMTP id by36so13120741ljb.4 for ; Mon, 10 Oct 2022 05:45:04 -0700 (PDT) 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=paQNRitfTZqGrcbmqiz4rcYjOGNl0Nv/qXv1E4bdQso=; b=DFrNqQa1wonEnL1VhcBOp4tx7mtXx1vvITY7VZIQL59Bkaybx/NRRQOvswN6JYgZjL h+wYy8nO+QbZ5dVbFnJBSKaLC+qnPW0WWIrNCbsZ5ZlFc+f4lkY5+/my+S6rv4xZyRtO hHvOne2Y4Og97WaIVuOO0QuvHidaybOYqo+EasWNsJbCs15TMEZyVZBp5I3UgsUb5QyH X1LIvALwb3corBrjjtZli02rSV2jD0DS+gLWCUD2EbqncrIi8dLKFXLe7zx0hF1InXMH uFM5WYSbr2/wP8w/LfGm7zFOQ3Yxv04vLWeptVHnlDD2h2pXiVz5gDknmJS2rSBn2b1P S+wQ== 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=paQNRitfTZqGrcbmqiz4rcYjOGNl0Nv/qXv1E4bdQso=; b=OyGmycqcQ4L+a/pUfSuaIto5VI0bpJXCdokF7eEr7rcXnWfj3qLPgGT4+fL+DoVE0H zcx6NNG4JYSPVEeDcWP3PJ+Oqv8xSBGbecXE8JuosI4q8ZHe8adi2xH0YUlZPRnahse4 kGDdMunuzQkssigzW0x5uMIjIb6k/EwK6kfnS7j7baFmumdQMoPME9RGSwZnN5w+rs8H PiTJnCI3zEx/2jfWEd0p0W3H7abOy5PRg5X8EUFhzWkJ40Ep26C6aBuU8zYRc1s8WYmZ G9fjSE3DGkQqb1qoUAPU7b2/DWwCgxs9tDUjdkO/6msWxsmOwafgj8hDRs3jKQFy8oE5 6GQg== X-Gm-Message-State: ACrzQf0Y5BtPfBqjHN4DNg6Rghum5/BGVnjEkk6deY/9D8g8JN89DzEF aHD7elrUg5FcRjakD/cLHSSnQhMI5zc= X-Received: by 2002:a2e:a7cf:0:b0:26e:8d31:cadc with SMTP id x15-20020a2ea7cf000000b0026e8d31cadcmr4150762ljp.344.1665405904109; Mon, 10 Oct 2022 05:45:04 -0700 (PDT) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id 14-20020a2e154e000000b0026dd1968533sm1657722ljv.86.2022.10.10.05.45.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 05:45:03 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 10 Oct 2022 15:44:56 +0300 Message-Id: <20221010124457.9213-2-jeebjp@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221010124457.9213-1-jeebjp@gmail.com> References: <20221010124457.9213-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v5 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: C4IPxlHR1bMX 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 fe350fe2bb..a7e6c0f6e0 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -2349,8 +2349,6 @@ static int process_subtitle(InputStream *ist, AVSubtitle *subtitle, int *got_out if (!subtitle->num_rects) goto out; - ist->frames_decoded++; - for (int i = 0; i < nb_output_streams; i++) { OutputStream *ost = output_streams[i]; @@ -2383,6 +2381,8 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output, return ret; } + ist->frames_decoded++; + return process_subtitle(ist, &subtitle, got_output); }