diff mbox series

[FFmpeg-devel,v6,2/3] ffmpeg: move decoded frame counter from after post-processing to decode

Message ID 20221219073408.11501-3-jeebjp@gmail.com
State New
Headers show
Series ffmpeg: add video heartbeat capability to fix_sub_duration | expand


Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Jan Ekström Dec. 19, 2022, 7:34 a.m. UTC
From: Jan Ekström <jan.ekstrom@24i.com>

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 <jan.ekstrom@24i.com>
 fftools/ffmpeg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series


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);