瀏覽代碼

iOS: Fix the constant return to the rootview when the application resign active (closes #14640)

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Soomin Lee 8 年之前
父節點
當前提交
77eda4b959
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. 7 3
      Sources/VLCMediaFileDiscoverer.m

+ 7 - 3
Sources/VLCMediaFileDiscoverer.m

@@ -23,6 +23,7 @@ const float MediaTimerInterval = 2.f;
     NSArray *_directoryFiles;
     NSArray *_directoryFiles;
     NSMutableDictionary *_addedFilesMapping;
     NSMutableDictionary *_addedFilesMapping;
     NSTimer *_addMediaTimer;
     NSTimer *_addMediaTimer;
+    NSArray *_discoveredFilePath;
 }
 }
 
 
 @end
 @end
@@ -306,9 +307,12 @@ const float MediaTimerInterval = 2.f;
             }
             }
         }
         }
     }
     }
-    for (id<VLCMediaFileDiscovererDelegate> delegate in _observers) {
-        if ([delegate respondsToSelector:@selector(mediaFilesFoundRequiringAdditionToStorageBackend:)]) {
-            [delegate mediaFilesFoundRequiringAdditionToStorageBackend:[filePaths copy]];
+    if (![_discoveredFilePath isEqualToArray:filePaths]) {
+        _discoveredFilePath = filePaths;
+        for (id<VLCMediaFileDiscovererDelegate> delegate in _observers) {
+            if ([delegate respondsToSelector:@selector(mediaFilesFoundRequiringAdditionToStorageBackend:)]) {
+                [delegate mediaFilesFoundRequiringAdditionToStorageBackend:[filePaths copy]];
+            }
         }
         }
     }
     }
 }
 }