Commit bade53fb authored by Felix Paul Kühne's avatar Felix Paul Kühne

VLCKit: don't return timestamps with hour digits, if time is shorter than 1 hour

parent 1ce5fef4
...@@ -75,15 +75,20 @@ ...@@ -75,15 +75,20 @@
if (value) if (value)
{ {
long long duration = [value longLongValue] / 1000000; long long duration = [value longLongValue] / 1000000;
if( duration > 3600 )
return [NSString stringWithFormat:@"%01d:%02d:%02d", return [NSString stringWithFormat:@"%01d:%02d:%02d",
(long) (duration / 3600), (long) (duration / 3600),
(long)((duration / 60) % 60), (long)((duration / 60) % 60),
(long) (duration % 60)]; (long) (duration % 60)];
else
return [NSString stringWithFormat:@"%02d:%02d",
(long)((duration / 60) % 60),
(long) (duration % 60)];
} }
else else
{ {
// Return a string that represents an undefined time. // Return a string that represents an undefined time.
return @"-:--:--"; return @"--:--";
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment