[FFmpeg-cvslog] ffmpeg: move decoded frame counter from after post-processing to decode

Jan Ekström git at videolan.org
Fri Feb 3 17:40:00 EET 2023


ffmpeg | branch: master | Jan Ekström <jan.ekstrom at 24i.com> | Fri Aug  5 10:50:57 2022 +0300| [746d27455b00f6baca2a1e4ab206cd40bf187598] | committer: Jan Ekström

ffmpeg: move decoded frame counter from after post-processing to decode

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 at 24i.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=746d27455b00f6baca2a1e4ab206cd40bf187598
---

 fftools/ffmpeg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index ba045b454c..e0a02260f5 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2341,8 +2341,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)
@@ -2373,6 +2371,8 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output,
         return ret;
     }
 
+    ist->frames_decoded++;
+
     return process_subtitle(ist, &subtitle, got_output);
 }
 



More information about the ffmpeg-cvslog mailing list