diff options
author | Martin Storsjö <martin@martin.st> | 2020-08-28 13:21:52 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2020-08-28 13:21:52 +0300 |
commit | f57189e30080c6d5a0389533e722f6f2bac20272 (patch) | |
tree | cc590c7e9f2e856999e814d2b669fe03d4a6f74f /tools | |
parent | 1bcc5ecd8a0a06be8eb964213ceae83f5d1e6d92 (diff) |
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.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dav1d.c | 12 |
1 files changed, 8 insertions, 4 deletions
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"); |