aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/upnp/Discovery.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/upnp/Discovery.cxx')
-rw-r--r--src/db/upnp/Discovery.cxx12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/db/upnp/Discovery.cxx b/src/db/upnp/Discovery.cxx
index 2824d4b56..a51b57a48 100644
--- a/src/db/upnp/Discovery.cxx
+++ b/src/db/upnp/Discovery.cxx
@@ -216,18 +216,14 @@ UPnPDeviceDirectory::expireDevices()
search();
}
-UPnPDeviceDirectory::UPnPDeviceDirectory()
- :m_searchTimeout(2), m_lastSearch(0)
+UPnPDeviceDirectory::UPnPDeviceDirectory(LibUPnP *_lib)
+ :lib(_lib), m_searchTimeout(2), m_lastSearch(0)
{
if (!discoveredQueue.start(1, discoExplorer, 0)) {
error.Set(upnp_domain, "Discover work queue start failed");
return;
}
- LibUPnP *lib = LibUPnP::getLibUPnP(error);
- if (lib == nullptr)
- return;
-
lib->SetHandler([](Upnp_EventType type, void *event){
cluCallBack(type, event);
});
@@ -243,10 +239,6 @@ UPnPDeviceDirectory::search()
return true;
m_lastSearch = now;
- LibUPnP *lib = LibUPnP::getLibUPnP(error);
- if (lib == nullptr)
- return false;
-
// We search both for device and service just in case.
int code = UpnpSearchAsync(lib->getclh(), m_searchTimeout,
ContentDirectorySType, lib);