Commit 555c8ac5 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Library: only show video dimensions format string if we actually have video dimensions

parent 2ec5a379
......@@ -84,8 +84,12 @@
self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %i MB", [VLCTime timeWithNumber:[self.mediaObject duration]], (int)([self.mediaObject fileSizeInBytes] / 1e6)];
else {
self.subtitleLabel.text = [NSString stringWithFormat:@"%@", [VLCTime timeWithNumber:[self.mediaObject duration]]];
if (self.mediaObject.videoTrack)
self.subtitleLabel.text = [self.subtitleLabel.text stringByAppendingFormat:@" — %@x%@", [[self.mediaObject videoTrack] valueForKey:@"width"], [[self.mediaObject videoTrack] valueForKey:@"height"]];
if (self.mediaObject.videoTrack) {
NSString *width = [[self.mediaObject videoTrack] valueForKey:@"width"];
NSString *height = [[self.mediaObject videoTrack] valueForKey:@"height"];
if (width.intValue > 0 && height.intValue > 0)
self.subtitleLabel.text = [self.subtitleLabel.text stringByAppendingFormat:@" — %@x%@", width, height];
}
}
if ([keyPath isEqualToString:@"computedThumbnail"] || !keyPath) {
static NSMutableArray *_thumbnailCacheIndex;
......
......@@ -69,8 +69,12 @@
self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %i MB", [VLCTime timeWithNumber:[self.mediaObject duration]], (int)([self.mediaObject fileSizeInBytes] / 1e6)];
else {
self.subtitleLabel.text = [NSString stringWithFormat:@"%@", [VLCTime timeWithNumber:[self.mediaObject duration]]];
if (self.mediaObject.videoTrack)
self.subtitleLabel.text = [self.subtitleLabel.text stringByAppendingFormat:@" — %@x%@", [[self.mediaObject videoTrack] valueForKey:@"width"], [[self.mediaObject videoTrack] valueForKey:@"height"]];
if (self.mediaObject.videoTrack) {
NSString *width = [[self.mediaObject videoTrack] valueForKey:@"width"];
NSString *height = [[self.mediaObject videoTrack] valueForKey:@"height"];
if (width.intValue > 0 && height.intValue > 0)
self.subtitleLabel.text = [self.subtitleLabel.text stringByAppendingFormat:@" — %@x%@", width, height];
}
}
if ([keyPath isEqualToString:@"computedThumbnail"] || !keyPath) {
static NSMutableArray *_thumbnailCacheIndex;
......
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