diff --git a/src/Backends/MPV/MPVBackend.cpp b/src/Backends/MPV/MPVBackend.cpp index 8abbb0b..babfc81 100644 --- a/src/Backends/MPV/MPVBackend.cpp +++ b/src/Backends/MPV/MPVBackend.cpp @@ -36,12 +36,6 @@ on_mpv_redraw(void* ctx) reinterpret_cast(ctx), "update", Qt::QueuedConnection); } -} // namespace - -class MpvRenderer : public QQuickFramebufferObject::Renderer -{ - MPVBackend* obj; - static void* get_proc_address_mpv(void* ctx, const char* name) { @@ -51,11 +45,15 @@ get_proc_address_mpv(void* ctx, const char* name) std::cerr << "No GLCTX :(" << std::endl; return nullptr; } - - return reinterpret_cast(glctx->getProcAddress(QByteArray(name))); } +} // namespace + +class MpvRenderer : public QQuickFramebufferObject::Renderer +{ + MPVBackend* obj; + public: MpvRenderer(MPVBackend* new_obj) : obj{ new_obj } @@ -70,7 +68,6 @@ public: { // init mpv_gl: if (!obj->mpv_gl) { - QOpenGLContext* glctx = QOpenGLContext::currentContext(); mpv_opengl_init_params gl_init_params{ get_proc_address_mpv, nullptr, nullptr }; diff --git a/src/Backends/MPV/MPVBackend.hpp b/src/Backends/MPV/MPVBackend.hpp index 5b121cd..533568c 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" +class MpvRenderer; + class MPVBackend : public QQuickFramebufferObject , public BackendInterface