Commit 9e0edacf authored by Carola Nitz's avatar Carola Nitz

VLCPlaybackController, VLCNetworkServerBrowserUPnP: don't reverse the order of mediaitems

since we're now parsing media in the correct order in VLCKit there is no need to reverse the order of media when handing it over.
This actually led to a bug in playlists where instead playing media at index 1, media at media.count -1 would be played.
parent e7886d46
......@@ -89,10 +89,9 @@
{
NSMutableArray *mediaArray;
@synchronized(_items) {
NSUInteger count = _items.count;
mediaArray = [NSMutableArray arrayWithCapacity:count];
for (NSInteger i = count - 1; i >= 0; i--) {
VLCMedia *media = [_items[i] media];
mediaArray = [NSMutableArray new];
for (id<VLCNetworkServerBrowserItem> item in _items) {
VLCMedia *media = [item media];
if (media)
[mediaArray addObject:media];
}
......
......@@ -122,7 +122,7 @@ Open a file in the libraryViewController without changing the playstate
{
VLCMediaList *list = [[VLCMediaList alloc] init];
VLCMedia *media;
for (MLFile *file in files.reverseObjectEnumerator) {
for (MLFile *file in files) {
media = [VLCMedia mediaWithURL:file.url];
[media addOptions:self.mediaOptionsDictionary];
[list addMedia:media];
......
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