From f57189e30080c6d5a0389533e722f6f2bac20272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 28 Aug 2020 13:21:52 +0300 Subject: cli: Print the decoding fps even if the file lacks a nominal framerate We can't compare the decoding speed with the intended decoding rate, but the frame rate alone is still useful. --- tools/dav1d.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/dav1d.c b/tools/dav1d.c index 4b97a9f..907af3f 100644 --- a/tools/dav1d.c +++ b/tools/dav1d.c @@ -124,11 +124,15 @@ static void print_stats(const int istty, const unsigned n, const unsigned num, else b += snprintf(b, end - b, "Decoded %u/%u frames (%.1lf%%)", n, num, 100.0 * n / num); - if (i_fps && b < end) { + if (b < end) { const double d_fps = 1e9 * n / elapsed; - const double speed = d_fps / i_fps; - b += snprintf(b, end - b, " - %.2lf/%.2lf fps (%.2lfx)", - d_fps, i_fps, speed); + if (i_fps) { + const double speed = d_fps / i_fps; + b += snprintf(b, end - b, " - %.2lf/%.2lf fps (%.2lfx)", + d_fps, i_fps, speed); + } else { + b += snprintf(b, end - b, " - %.2lf fps", d_fps); + } } if (!istty) strcpy(b > end - 2 ? end - 2 : b, "\n"); -- cgit v1.2.3