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 4754345027
.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
This commit is contained in:
Jan Ekström 2022-08-05 10:50:57 +03:00 committed by Jan Ekström
parent fcc50674de
commit 746d27455b
1 changed files with 2 additions and 2 deletions

View File

@ -2341,8 +2341,6 @@ static int process_subtitle(InputStream *ist, AVSubtitle *subtitle, int *got_out
if (!subtitle->num_rects) if (!subtitle->num_rects)
goto out; goto out;
ist->frames_decoded++;
for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) {
if (!check_output_constraints(ist, ost) || !ost->enc_ctx if (!check_output_constraints(ist, ost) || !ost->enc_ctx
|| ost->enc_ctx->codec_type != AVMEDIA_TYPE_SUBTITLE) || 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; return ret;
} }
ist->frames_decoded++;
return process_subtitle(ist, &subtitle, got_output); return process_subtitle(ist, &subtitle, got_output);
} }