[totem/wip/hadess/remaining-time: 3/8] backend: Fix remaining label when time > length



commit f9019f4466c7d5b7f2237af3172c8318105cccc6
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Feb 19 03:56:23 2019 +0100

    backend: Fix remaining label when time > length
    
    The OSD for the remaining time would get a bit funny when the current
    time in the playback is longer than the length.
    
    When time > length, we set the remaining time as "--:--".
    
    Closes: #236

 src/backend/bacon-time-label.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/backend/bacon-time-label.c b/src/backend/bacon-time-label.c
index c71f5cc9d..d71bfc5aa 100644
--- a/src/backend/bacon-time-label.c
+++ b/src/backend/bacon-time-label.c
@@ -105,7 +105,8 @@ update_label_text (BaconTimeLabel *label)
        if (length > 60 * 60 * 1000)
                force_hour = TRUE;
 
-       if (length <= 0) {
+       if (length <= 0 ||
+           _time > length) {
                if (!label->priv->remaining) {
                        label_str = totem_time_to_string (_time, FALSE, force_hour);
                } else {


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