From a9219531c2e286f65b3a1d137f61b72987b960b1 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 23 May 2021 05:12:53 +0200 Subject: Only use x11egl mpv option when running wayland. Disable video disk cache, use mpv default instead --- src/Utils.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/Utils.cpp') diff --git a/src/Utils.cpp b/src/Utils.cpp index 7ed6574..3da045e 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -9,6 +9,8 @@ namespace QuickMedia { static bool scale_set = false; static bool qm_enable_touch = false; static bool qm_enable_touch_set = false; + static bool wayland_display_set = false; + static const char *wayland_display = nullptr; static const int XFT_DPI_DEFAULT = 96; // Returns 96 on error @@ -86,6 +88,15 @@ namespace QuickMedia { return qm_enable_touch; } + bool is_running_wayland() { + if(wayland_display_set) + return wayland_display; + + wayland_display = getenv("WAYLAND_DISPLAY"); + wayland_display_set = true; + return wayland_display; + } + time_t iso_utc_to_unix_time(const char *time_str) { int year = 0; int month = 0; -- cgit v1.2.3