From 3819571ec0fd066ab08fe4f4ce1ad70ce1eb8d3f Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Sun, 21 Nov 2021 22:39:11 +0100 Subject: [PATCH] Fixed UI display time in readable form --- GstToolkit.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/GstToolkit.cpp b/GstToolkit.cpp index df6fce2..d305e3a 100644 --- a/GstToolkit.cpp +++ b/GstToolkit.cpp @@ -58,10 +58,12 @@ string GstToolkit::time_to_string(guint64 t, time_string_mode m) if (count < 2) { oss << setw(count > 0 ? 2 : 1) << setfill('0') << (s % 3600) % 60; count++; + + if (count < 2 ) + oss << '.'<< setw(1) << setfill('0') << (ms % 1000) / 100 << " sec"; + else + oss << " s"; } - if (count < 2 ) - oss << '.'<< setw(1) << setfill('0') << (ms % 1000) / 100; - oss << " sec"; } // MINIMAL: keep only the 2 higher values (most significant) else if (m == TIME_STRING_MINIMAL) {