|
a/libupnpp/device/device.cxx |
|
b/libupnpp/device/device.cxx |
|
... |
|
... |
21 |
|
21 |
|
22 |
#include <iostream>
|
22 |
#include <iostream>
|
23 |
using namespace std;
|
23 |
using namespace std;
|
24 |
|
24 |
|
25 |
#include "libupnpp/upnpplib.hxx"
|
25 |
#include "libupnpp/upnpplib.hxx"
|
|
|
26 |
#include "libupnpp/upnpputils.hxx"
|
26 |
#include "libupnpp/log.hxx"
|
27 |
#include "libupnpp/log.hxx"
|
27 |
#include "vdir.hxx"
|
28 |
#include "vdir.hxx"
|
28 |
#include "device.hxx"
|
29 |
#include "device.hxx"
|
|
|
30 |
|
|
|
31 |
using namespace UPnPP;
|
29 |
|
32 |
|
30 |
namespace UPnPProvider {
|
33 |
namespace UPnPProvider {
|
31 |
|
34 |
|
32 |
unordered_map<std::string, UpnpDevice *> UpnpDevice::o_devices;
|
35 |
unordered_map<std::string, UpnpDevice *> UpnpDevice::o_devices;
|
33 |
|
36 |
|
|
... |
|
... |
294 |
}
|
297 |
}
|
295 |
}
|
298 |
}
|
296 |
|
299 |
|
297 |
static pthread_cond_t evloopcond = PTHREAD_COND_INITIALIZER;
|
300 |
static pthread_cond_t evloopcond = PTHREAD_COND_INITIALIZER;
|
298 |
|
301 |
|
299 |
static void timespec_addnanos(struct timespec *ts, int nanos)
|
|
|
300 |
{
|
|
|
301 |
ts->tv_nsec += nanos;
|
|
|
302 |
if (ts->tv_nsec > 1000 * 1000 * 1000) {
|
|
|
303 |
int secs = ts->tv_nsec / (1000 * 1000 * 1000);
|
|
|
304 |
ts->tv_sec += secs;
|
|
|
305 |
ts->tv_nsec -= secs * (1000 * 1000 * 1000);
|
|
|
306 |
}
|
|
|
307 |
}
|
|
|
308 |
int timespec_diffms(const struct timespec& old, const struct timespec& recent)
|
302 |
int timespec_diffms(const struct timespec& old, const struct timespec& recent)
|
309 |
{
|
303 |
{
|
310 |
return (recent.tv_sec - old.tv_sec) * 1000 +
|
304 |
return (recent.tv_sec - old.tv_sec) * 1000 +
|
311 |
(recent.tv_nsec - old.tv_nsec) / (1000 * 1000);
|
305 |
(recent.tv_nsec - old.tv_nsec) / (1000 * 1000);
|
312 |
}
|
306 |
}
|