From 82234b4454299e0472344d5cf71bd8f70586133e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 15 Oct 2021 03:42:45 +0200 Subject: Remove dependency on xrdb for Xft.dpi --- src/plugins/youtube/YoutubeMediaProxy.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/plugins') 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 #include @@ -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; -- cgit v1.2.3