diff mbox series

[FFmpeg-devel,36/49] fftools/ffmpeg: stop using OutputStream.frame_number in print_report()

Message ID 20220404113037.13070-37-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/49] fftools/ffmpeg: drop an obsolete hack | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed

Commit Message

Anton Khirnov April 4, 2022, 11:30 a.m. UTC
This field means different things for video encoding (number of frames
emitted to the encoding sync queue/encoder by the video sync code) and
for everything else (number of packets sent to the muxer sync queue).

Print the value of packets_written instead, which means the same thing
for all kinds of streams. It is also more consistent with the code
below, which prints PSNR from the last muxed packet.
---
 fftools/ffmpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index e46554ddf4..53b3657ec9 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1531,7 +1531,7 @@  static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
         if (!vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
             float fps;
 
-            frame_number = ost->frame_number;
+            frame_number = ost->packets_written;
             fps = t > 1 ? frame_number / t : 0;
             av_bprintf(&buf, "frame=%5d fps=%3.*f q=%3.1f ",
                      frame_number, fps < 9.95, fps, q);