瀏覽代碼

fix upnpx crash until resolved upstream

(cherry picked from commit e12e68580f7d0de77d6e68fb8cf9e6e536c1a65f)
Felix Paul Kühne 10 年之前
父節點
當前提交
82e7de5fd1
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Sources/VLCLocalServerListViewController.m

+ 5 - 1
Sources/VLCLocalServerListViewController.m

@@ -64,6 +64,7 @@
 
     BOOL _udnpDiscoveryRunning;
     NSTimer *_searchTimer;
+    BOOL _setup;
 }
 
 @property (nonatomic) VLCHTTPUploaderController *uploadController;
@@ -240,7 +241,10 @@
     [[managerInstance DB] addObserver:self];
 
     //Optional; set User Agent
-    [[managerInstance SSDP] setUserAgentProduct:[NSString stringWithFormat:@"VLCforiOS/%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]] andOS:[NSString stringWithFormat:@"iOS/%@", [[UIDevice currentDevice] systemVersion]]];
+    if (!_setup) {
+        [[managerInstance SSDP] setUserAgentProduct:[NSString stringWithFormat:@"VLCforiOS/%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]] andOS:[NSString stringWithFormat:@"iOS/%@", [[UIDevice currentDevice] systemVersion]]];
+        _setup = YES;
+    }
 
     //Search for UPnP Devices
     [[managerInstance SSDP] startSSDP];