diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-10-15 03:42:45 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-10-15 03:42:45 +0200 |
commit | 82234b4454299e0472344d5cf71bd8f70586133e (patch) | |
tree | 9bffba836fa86fb5c293d46fc5d94fb08196cff4 /src/plugins | |
parent | e1c8cd4430015a307dbcb32894a030d5a13aee67 (diff) |
Remove dependency on xrdb for Xft.dpi
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/youtube/YoutubeMediaProxy.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/plugins/youtube/YoutubeMediaProxy.cpp b/src/plugins/youtube/YoutubeMediaProxy.cpp index c5af20e..4fe6c74 100644 --- a/src/plugins/youtube/YoutubeMediaProxy.cpp +++ b/src/plugins/youtube/YoutubeMediaProxy.cpp @@ -1,5 +1,6 @@ #include "../../../plugins/youtube/YoutubeMediaProxy.hpp" #include "../../../include/NetUtils.hpp" +#include "../../../include/Utils.hpp" #include <vector> #include <stdio.h> @@ -465,10 +466,7 @@ namespace QuickMedia { total_downloaded_bytes = 0; download_started = true; throttle_started = false; - - struct timespec tp; - clock_gettime(CLOCK_MONOTONIC, &tp); - download_start_time = tp.tv_sec; + download_start_time = get_boottime_milliseconds(); } total_downloaded_bytes += downloader_num_read_bytes; } @@ -476,10 +474,7 @@ namespace QuickMedia { #if 0 if(download_started) { - struct timespec tp; - clock_gettime(CLOCK_MONOTONIC, &tp); - - int64_t time_elapsed = tp.tv_sec - download_start_time; + const int64_t time_elapsed_sec = (get_boottime_milliseconds() - download_start_time) / 1000; int64_t download_speed_kb_sec = 0; if(time_elapsed > 0) download_speed_kb_sec = (total_downloaded_bytes / time_elapsed) / 1024; |