aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-08-09 19:00:49 +0200
committerdec05eba <dec05eba@protonmail.com>2019-08-09 19:00:52 +0200
commit18048b410e2544a22ff923892d0c934b50905557 (patch)
tree1702edf089fe1353389784942352aee59c5a9337
parenta1c429ca4de1d0a042889a491b17dab6e66429db (diff)
Sleep video player
-rw-r--r--src/QuickMedia.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 10d2280..a7dc7ff 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -523,8 +523,10 @@ namespace QuickMedia {
}
if(video_player_ui_window) {
- if(!ui_visible)
+ if(!ui_visible) {
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
continue;
+ }
if(ui_hide_timer.getElapsedTime().asMilliseconds() > UI_HIDE_TIMEOUT) {
ui_visible = false;
@@ -550,6 +552,8 @@ namespace QuickMedia {
video_player->set_progress((double)mouse_pos.x / (double)window_size.x);
}
}
+ } else {
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
}