Add backwards compat for pre 1.18 mpv.
This commit is contained in:
parent
1b5495573e
commit
4685489580
|
@ -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)
|
||||
|
|
|
@ -16,7 +16,9 @@
|
|||
#include <exception>
|
||||
#include <iosfwd>
|
||||
#include <memory>
|
||||
#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<UtilsClass>("player", 1, 0, "Utils");
|
||||
|
||||
#ifndef DISABLE_MPV_RENDER_API
|
||||
if (settings.value("Backend/fbo", true).toBool()) {
|
||||
qmlRegisterType<MPVBackend>("player", 1, 0, "PlayerBackend");
|
||||
} else {
|
||||
qmlRegisterType<MPVNoFBOBackend>("player", 1, 0, "PlayerBackend");
|
||||
}
|
||||
|
||||
#else
|
||||
qmlRegisterType<MPVNoFBOBackend>("player", 1, 0, "PlayerBackend");
|
||||
#endif
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
launcherLogger->info("Loading player...");
|
||||
|
||||
|
|
Loading…
Reference in a new issue