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

Felix Paul Kühne git at videolan.org
Tue Jun 21 16:17:37 CEST 2016


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

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

(cherry picked from commit 62dfbc3856fbcdec5fa9c592089b3cc8a228b292)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=4c9a5ac7cd9a0586e8feee791ef6013b07b5945a
---

 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 b712413..03a7019 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -977,7 +977,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
     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]];
 
     NSString *playbackDuration = [NSString stringWithFormat:@" — %@",[formatter stringFromDate:date]];



More information about the vlc-commits mailing list