[vlc-commits] macosx: fix time format overflow if playlist duration is > 24h

Felix Paul Kühne git at videolan.org
Tue Jun 21 15:44:36 CEST 2016


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Jun 21 15:44:24 2016 +0200| [62dfbc3856fbcdec5fa9c592089b3cc8a228b292] | committer: Felix Paul Kühne

macosx: fix time format overflow if playlist duration is > 24h

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=62dfbc3856fbcdec5fa9c592089b3cc8a228b292
---

 modules/gui/macosx/MainWindow.m |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 4043b39..db8c971 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -977,7 +977,11 @@ static const float f_min_window_height = 307.;
 
     NSDate *date = [NSDate dateWithTimeIntervalSince1970:mt_duration];
     NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
-    [formatter setDateFormat:@"HH:mm:ss"];
+    if (mt_duration >= 86400) {
+        [formatter setDateFormat:@"dd:HH:mm:ss"];
+    } else {
+        [formatter setDateFormat:@"HH:mm:ss"];
+    }
     [formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
 
     return [NSString stringWithFormat:@" — %@",[formatter stringFromDate:date]];



More information about the vlc-commits mailing list