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

Jan Ekström jeebjp at gmail.com
Fri Aug 5 16:19:44 EEST 2022


From: Jan Ekström <jan.ekstrom at 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 at 24i.com>
---
 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);
 }
 
-- 
2.37.1



More information about the ffmpeg-devel mailing list