Browse Source

fix upnpx crash until resolved upstream

(cherry picked from commit e12e68580f7d0de77d6e68fb8cf9e6e536c1a65f)
Felix Paul Kühne 10 years ago
parent
commit
82e7de5fd1
1 changed files with 5 additions and 1 deletions
  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];