[totem/wip/hadess/remaining-time: 4/8] gst: Add guard for the remaining time label problem



commit e7edac8add711a5b2cc1973f92c10ce0af59c88b
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Feb 19 03:57:06 2019 +0100

    gst: Add guard for the remaining time label problem
    
    We expect all the times passed to be positive, prefixing "-"
    is done when showing the remaining time.

 src/gst/totem-time-helpers.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/gst/totem-time-helpers.c b/src/gst/totem-time-helpers.c
index cd868de56..0d7754d4e 100644
--- a/src/gst/totem-time-helpers.c
+++ b/src/gst/totem-time-helpers.c
@@ -39,6 +39,8 @@ totem_time_to_string (gint64   msecs,
 {
        int sec, min, hour, _time;
 
+       g_return_val_if_fail (msecs >= 0, NULL);
+
        _time = (int) (msecs / 1000);
        /* When calculating the remaining time,
         * we want to make sure that:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]