소스 검색

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];