Switch to unified view
a/libupnpp/upnpavutils.cxx | b/libupnpp/upnpavutils.cxx | ||
---|---|---|---|
... |
... |
||
16 | */ |
16 | */ |
17 | #include <string> |
17 | #include <string> |
18 | using namespace std; |
18 | using namespace std; |
19 | 19 | ||
20 | #include "libupnpp/upnpavutils.hxx" |
20 | #include "libupnpp/upnpavutils.hxx" |
21 | |||
22 | namespace UPnPP { |
||
21 | 23 | ||
22 | // Format duration in milliseconds into UPnP duration format |
24 | // Format duration in milliseconds into UPnP duration format |
23 | string upnpduration(int ms) |
25 | string upnpduration(int ms) |
24 | { |
26 | { |
25 | int hours = ms / (3600 * 1000); |
27 | int hours = ms / (3600 * 1000); |
... |
... |
||
46 | if (sscanf(dur.c_str(), "%d:%d:%d", &hours, &minutes, &seconds) != 3) { |
48 | if (sscanf(dur.c_str(), "%d:%d:%d", &hours, &minutes, &seconds) != 3) { |
47 | return 0; |
49 | return 0; |
48 | } |
50 | } |
49 | return 3600 * hours + 60 * minutes + seconds; |
51 | return 3600 * hours + 60 * minutes + seconds; |
50 | } |
52 | } |
53 | |||
54 | } |