[totem] gst: Fix up remaining time display
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] gst: Fix up remaining time display
- Date: Thu, 4 Apr 2013 14:03:13 +0000 (UTC)
commit 032af8b000801e6a55a2987993fe8424bcc5e46d
Author: Bastien Nocera <hadess hadess net>
Date: Thu Apr 4 10:58:41 2013 +0200
gst: Fix up remaining time display
When calculating the remaining time, we want to make sure that:
current time + time remaining = total run time
src/gst/totem-time-helpers.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/gst/totem-time-helpers.c b/src/gst/totem-time-helpers.c
index 0e2cfb2..69d966b 100644
--- a/src/gst/totem-time-helpers.c
+++ b/src/gst/totem-time-helpers.c
@@ -30,7 +30,6 @@
#include "totem-time-helpers.h"
-
/* FIXME: Remove
* See https://bugzilla.gnome.org/show_bug.cgi?id=679850 */
char *
@@ -41,6 +40,12 @@ totem_time_to_string (gint64 msecs,
int sec, min, hour, _time;
_time = (int) (msecs / 1000);
+ /* When calculating the remaining time,
+ * we want to make sure that:
+ * current time + time remaining = total run time */
+ if (remaining)
+ _time++;
+
sec = _time % 60;
_time = _time - sec;
min = (_time % (60*60)) / 60;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]