Jelajahi Sumber

plex : fix playing wrong file
(cherry picked from commit 10e120a7f734c7f9ecb321673c6215e51ca722f6)

Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>

Pierre SAGASPE 9 tahun lalu
induk
melakukan
90e2c544d0

+ 4 - 2
SharedSources/ServerBrowsing/Plex/VLCNetworkServerBrowserPlex.m

@@ -123,15 +123,17 @@
 
 - (VLCMediaList *)buildMediaList
 {
-    VLCMediaList *mediaList = [[VLCMediaList alloc] init];
+    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];
             if (media)
-                [mediaList addMedia:media];
+                [mediaArray addObject:media];
         }
     }
+    VLCMediaList *mediaList = [[VLCMediaList alloc] initWithArray:mediaArray];
     return mediaList;
 }