Commit 3dd4b4f8 authored by Felix Paul Kühne's avatar Felix Paul Kühne

local network: do not re-init DSM discovery if it already runs and dispatch...

local network: do not re-init DSM discovery if it already runs and dispatch the init from the main thread
parent 68f68009
......@@ -111,7 +111,7 @@
if (_reachability.currentReachabilityStatus == ReachableViaWiFi) {
[self _startUPNPDiscovery];
[self performSelectorInBackground:@selector(_startSAPDiscovery) withObject:nil];
[self performSelectorInBackground:@selector(_startDSMDiscovery) withObject:nil];
[self _startDSMDiscovery];
}
}
......@@ -212,7 +212,7 @@
if (_reachability.currentReachabilityStatus == ReachableViaWiFi) {
[self _startUPNPDiscovery];
[self performSelectorInBackground:@selector(_startSAPDiscovery) withObject:nil];
[self performSelectorInBackground:@selector(_startDSMDiscovery) withObject:nil];
[self _startDSMDiscovery];
} else {
[self _stopUPNPDiscovery];
[self _stopSAPDiscovery];
......@@ -461,9 +461,9 @@
[self.tableView reloadData];
[self performSelectorInBackground:@selector(_startUPNPDiscovery) withObject:nil];
[self _startUPNPDiscovery];
[self performSelectorInBackground:@selector(_startSAPDiscovery) withObject:nil];
[self performSelectorInBackground:@selector(_startDSMDiscovery) withObject:nil];
[self _startDSMDiscovery];
}
#pragma mark - login panel protocol
......@@ -654,8 +654,10 @@
if (_reachability.currentReachabilityStatus != ReachableViaWiFi)
return;
if (!_dsmDiscoverer)
_dsmDiscoverer = [[VLCMediaDiscoverer alloc] initWithName:@"dsm"];
if (_dsmDiscoverer)
return;
_dsmDiscoverer = [[VLCMediaDiscoverer alloc] initWithName:@"dsm"];
[_dsmDiscoverer startDiscoverer];
_dsmDiscoverer.discoveredMedia.delegate = self;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment