diff --git a/CMakeLists.txt b/CMakeLists.txt index c9c72e4..37f02ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,11 @@ execute_process( include_directories(${CMAKE_BINARY_DIR}/spdlog/include) +if(MPV_VERSION VERSION_GREATER_EQUAL "1.28.0") +set(SOURCES ${SOURCES} src/Backends/MPV/MPVBackend.cpp) +else() +add_definitions(-DDISABLE_MPV_RENDER_API) +endif() if(X11_FOUND AND Xext_FOUND) @@ -56,8 +61,8 @@ set(SOURCES src/logger.cpp src/qmldebugger.cpp src/Backends/MPVCommon/MPVCommon.cpp - src/Backends/MPV/MPVBackend.cpp src/Backends/MPVNoFBO/MPVNoFBOBackend.cpp + ${SOURCES} ) find_program(CCACHE_FOUND cache) diff --git a/src/main.cpp b/src/main.cpp index 2e80338..4bff60e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,7 +16,9 @@ #include #include #include +#ifndef DISABLE_MPV_RENDER_API #include "Backends/MPV/MPVBackend.hpp" +#endif #include "Backends/MPVNoFBO/MPVNoFBOBackend.hpp" #include "Process.h" #include "ThumbnailCache.h" @@ -151,12 +153,15 @@ main(int argc, char* argv[]) qmlRegisterType("player", 1, 0, "Utils"); +#ifndef DISABLE_MPV_RENDER_API if (settings.value("Backend/fbo", true).toBool()) { qmlRegisterType("player", 1, 0, "PlayerBackend"); } else { qmlRegisterType("player", 1, 0, "PlayerBackend"); } - +#else + qmlRegisterType("player", 1, 0, "PlayerBackend"); +#endif setlocale(LC_NUMERIC, "C"); launcherLogger->info("Loading player...");