瀏覽代碼

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

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

Pierre SAGASPE 9 年之前
父節點
當前提交
90e2c544d0
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      SharedSources/ServerBrowsing/Plex/VLCNetworkServerBrowserPlex.m

+ 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;
 }