fftools/ffmpeg: stop accessing OutputStream.last_dropped in print_report()

That field is used by the framerate code to track whether any output has
been generated for the last input frame(*). Its use in the last
invocation of print_report() is meant to account for the very last
filtered frame being dropped in the number of dropped frames printed in
the log. However, that is a highly inappropriate place to do so, as it
makes assumptions about vsync logic in completely unrelated code. Move
the increment to encoder flush instead.

(*) the name is misleading, as the input frame has not yet been dropped
    and may still be output in the future
This commit is contained in:
Anton Khirnov 2023-09-09 20:31:48 +02:00
parent d2c416fdf1
commit 61777c62d7
2 changed files with 3 additions and 3 deletions

View File

@ -566,9 +566,6 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
pts -= copy_ts_first_pts;
}
}
if (is_last_report)
nb_frames_drop += ost->last_dropped;
}
us = FFABS64U(pts) % AV_TIME_BASE;

View File

@ -749,6 +749,9 @@ static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame)
if (frame->sample_aspect_ratio.num && !ost->frame_aspect_ratio.num)
enc->sample_aspect_ratio = frame->sample_aspect_ratio;
} else if (ost->last_dropped) {
ost->nb_frames_drop++;
ost->last_dropped = 0;
}
update_benchmark(NULL);