shithub: dav1d

Download patch

ref: f57189e30080c6d5a0389533e722f6f2bac20272
parent: 1bcc5ecd8a0a06be8eb964213ceae83f5d1e6d92
author: Martin Storsjö <[email protected]>
date: Fri Aug 28 09:21:52 EDT 2020

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.

--- a/tools/dav1d.c
+++ b/tools/dav1d.c
@@ -124,11 +124,15 @@
     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");