From e42447d45ed4bdaf845c2a194421d13dc3a09af6 Mon Sep 17 00:00:00 2001 From: namedkitten Date: Sun, 12 Apr 2020 13:57:06 +0100 Subject: [PATCH] Hacky fix for direct setting. --- src/Backends/MPV/MPVBackend.cpp | 6 ++++-- src/Backends/MPV/MPVBackend.hpp | 2 ++ src/main.cpp | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Backends/MPV/MPVBackend.cpp b/src/Backends/MPV/MPVBackend.cpp index 95356b8..c662873 100644 --- a/src/Backends/MPV/MPVBackend.cpp +++ b/src/Backends/MPV/MPVBackend.cpp @@ -23,6 +23,10 @@ auto mpvLogger = initLogger("mpv"); bool usedirect = false; +void setUseDirect(bool h) { + usedirect = h; +} + namespace { void @@ -138,8 +142,6 @@ MPVBackend::MPVBackend(QQuickItem* parent) { if (!mpv) throw std::runtime_error("could not create mpv context"); - QSettings settings; - usedirect = settings.value("Backend/direct", false).toBool(); mpv_set_option_string(mpv, "terminal", "on"); mpv_set_option_string(mpv, "msg-level", "all=v"); diff --git a/src/Backends/MPV/MPVBackend.hpp b/src/Backends/MPV/MPVBackend.hpp index 9eebeae..39379f4 100644 --- a/src/Backends/MPV/MPVBackend.hpp +++ b/src/Backends/MPV/MPVBackend.hpp @@ -15,6 +15,8 @@ #include "src/enums.hpp" #include "src/utils.hpp" +void setUseDirect(bool); + class MpvRenderer; class MPVBackend diff --git a/src/main.cpp b/src/main.cpp index dad7e8d..e3a9d01 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -109,6 +109,8 @@ main(int argc, char* argv[]) QSettings settings; + setUseDirect(settings.value("backend/direct", false).toBool()); + Utils::SetDPMS(false); QString newpath =