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

UPnP browsing: simplify media list creation and output items in the display order

parent 39b2687a
......@@ -86,16 +86,16 @@
- (VLCMediaList *)mediaList
{
NSMutableArray *mediaArray = [NSMutableArray array];
VLCMediaList *mediaList = [[VLCMediaList alloc] init];
@synchronized(_items) {
NSUInteger count = _items.count;
for (NSUInteger i = 0; i < count; i++) {
for (NSInteger i = count - 1; i >= 0; i--) {
VLCMedia *media = [_items[i] media];
if (media)
[mediaArray addObject:media];
[mediaList addMedia:media];
}
}
return [[VLCMediaList alloc] initWithArray:mediaArray];
return mediaList;
}
@end
......@@ -318,16 +318,16 @@
- (VLCMediaList *)mediaList
{
NSMutableArray *mediaArray = [NSMutableArray array];
VLCMediaList *mediaList = [[VLCMediaList alloc] init];
@synchronized(_items) {
NSUInteger count = _items.count;
for (NSUInteger i = 0; i < count; i++) {
for (NSInteger i = count - 1; i >= 0; i--) {
VLCMedia *media = [_items[i] media];
if (media)
[mediaArray addObject:media];
[mediaList addMedia:media];
}
}
return [[VLCMediaList alloc] initWithArray:mediaArray];
return mediaList;
}
@end
......
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