From patchwork Fri Aug 5 13:19:44 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: 37147 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:92a9:b0:8d:7f3b:94fc with SMTP id q41csp186792pzg; Fri, 5 Aug 2022 06:20:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR7lPLt0vVNl29+KbZ6nlHgc4UNmxyDqxRtOVP9HFdUTLg1Rmp3AzoV3Lk7rz9kaQU4cI1XN X-Received: by 2002:a17:907:971c:b0:72b:83d2:aa7a with SMTP id jg28-20020a170907971c00b0072b83d2aa7amr5198711ejc.633.1659705629197; Fri, 05 Aug 2022 06:20:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659705629; cv=none; d=google.com; s=arc-20160816; b=XEr6WwngWr15XpHWXMxb/u3EpCiifVt96+rYe7kMYgb+TQsV4/myCyis9oPndsJFvL nOB3+pmqxXpfhBJUELr+ppnTtca7QFz9oCNZeYchomnr3XmBikI9ikeE9hAFOhbo3K7x bk72QL9Ovbwd0APFyVtiQqQEbp7HOpRoOECc14nnwNp0Olv0QsiY7gU1op4zOJkA6s2D j1SkPcRpJo6Ag4K7gCCL+oPyanhhyDu2zj6qiLGJjoTp3XvpXYtmgd2xWjN8p0caA92L ymaasAr0lk9hrlCWM/8Td5873UViK07s6GQYNSTYWoKX8h2BZiTQquyMc+gjLsY4h2zd AmdA== 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=y4olmpk6p4TwC6IAZbwdujXq/3DhOQYiBu9kwqbE80w=; b=cXYKBNwxjAEtYSivbSALN7742NQfNazWFBJk6UyFLD1NJoqX6DlSZewXcHd0NacUC+ JTXm5axOc5g6VAqFZ+rKpVvF/oHrTEk4pZMVLbiIcAzYiDOvssal/0WnbuRtrbmxZ/3l mV2MDoGwDIW048K3zq4k/zW81E+JruE7Ydr5jLDJh9mUNv7zmEFxXJg7W7T3l5llcmRn 2c9sK6b2D3v7eyf2+BMGArKokVu0UgXXM//iMYnF/IpFUJ5nTvo/9/kpAfqGtc75MDpz 3QKlvSjM7G/N3zNtBQy/dvC/P04Hb+qe6MSfzo2dmlEZXOh6TPn8UsT9eGbtM3E9YLrl SvjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=LCOZIxqc; 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 cw13-20020a170906478d00b007304faaafc0si4102655ejc.432.2022.08.05.06.20.15; Fri, 05 Aug 2022 06:20:29 -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=LCOZIxqc; 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 5B7B868B613; Fri, 5 Aug 2022 16:20:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 32CE068B4F6 for ; Fri, 5 Aug 2022 16:19:53 +0300 (EEST) Received: by mail-lf1-f54.google.com with SMTP id u1so3421686lfq.4 for ; Fri, 05 Aug 2022 06:19:53 -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; bh=IsH7NhWW+hwh+bjCLO6810fg4l+MQBZYIxTJlZnIdJM=; b=LCOZIxqcQYxj5eg66ib2a1wx8rvnBvoYSKtkkdoIEqnUGpXlD0csZLbaiiX7iY3JsG rqvEGbDQ/72cuBTIgOCC/lCA/7XZu3Ku1Sux8vp2lRZifXSUCCoq1DUs+CEQdZu3y3cO 4Chl6/SeHmF4NCFGoFdrgEG+ctvwGrfRn+lIu2I5uI/GouRECr8dSrIGJGVb7GlRuk8J N1LKU01FpV1jBjzYSawbb9GUhF/H1fLWMbKlHvYpuIQpO4cnhF7QT3RMnw9SSy0lxwT6 YUvVHJeTCOSPBvuubOLeq5I3oif5yfRx/DQmQKo+pHYl+9IZdrl5Gpmu/NiIXJIqlJuN BklQ== 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; bh=IsH7NhWW+hwh+bjCLO6810fg4l+MQBZYIxTJlZnIdJM=; b=UOTAOvEfFdZg/FdQcNEYJfG+TI5llMDx2jLqVcvM/xsIAYdj/DiCprvYNOaJ3d4f+h nL0wp1wQHLrShID1bJXrxdItJbiW1wInYmNzqYcGZkRk+Zb04rrR1Bl9ZhWJJDJCs8Qs e6N0Rp8hmaPukPgc+VFyGpDFkvricaRvA6+5n0XLzd7fy60NShbjopJA6RqB/82YPQyB ykZ3IQ0yZty+S+nBntOJInuRtBsH7KD0xNWr85T7/5t2C8RODDGh2YCKG0seC/7Z7h76 tedXj/8a9ujp3f7euX/lhDHB8Ek3MAgEAup4ZaM3Qw7x6gYZh2A/p6smaq94p52bnieH oPWw== X-Gm-Message-State: ACgBeo1i4PYRdE7DrkS12Jydca3Sj00Ixr45j0h6bimxTj9tG1forABy LEyUdd8GajQZ9ocDNL13smMD1PdBAdU= X-Received: by 2002:a05:6512:10c1:b0:48a:b8cb:ef2d with SMTP id k1-20020a05651210c100b0048ab8cbef2dmr2204157lfg.384.1659705592533; Fri, 05 Aug 2022 06:19:52 -0700 (PDT) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id o20-20020a2e9b54000000b0025e2c5a12b6sm467373ljj.129.2022.08.05.06.19.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:19:51 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Aug 2022 16:19:44 +0300 Message-Id: <20220805131945.21970-2-jeebjp@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220805131945.21970-1-jeebjp@gmail.com> References: <20220729133537.53269-1-jeebjp@gmail.com> <20220805131945.21970-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 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: 9hwA2mlnxGQ1 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 9b514a2db5..019d6b821b 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -2347,8 +2347,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]; @@ -2381,6 +2379,8 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output, return ret; } + ist->frames_decoded++; + return process_subtitle(ist, &subtitle, got_output); }