1
mirror of https://code.videolan.org/videolan/vlc synced 2024-10-07 03:56:28 +02:00

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

This commit is contained in:
Felix Paul Kühne 2009-08-19 22:23:42 +02:00
parent 1ce5fef45b
commit bade53fbca

View File

@ -75,15 +75,20 @@
if (value)
{
long long duration = [value longLongValue] / 1000000;
return [NSString stringWithFormat:@"%01d:%02d:%02d",
(long) (duration / 3600),
(long)((duration / 60) % 60),
(long) (duration % 60)];
if( duration > 3600 )
return [NSString stringWithFormat:@"%01d:%02d:%02d",
(long) (duration / 3600),
(long)((duration / 60) % 60),
(long) (duration % 60)];
else
return [NSString stringWithFormat:@"%02d:%02d",
(long)((duration / 60) % 60),
(long) (duration % 60)];
}
else
{
// Return a string that represents an undefined time.
return @"-:--:--";
return @"--:--";
}
}