fix scaling problem in libmpv + fix url of libmpv
This commit is contained in:
parent
5a10a24a19
commit
0edb3ca104
@ -48,8 +48,10 @@ $zlib_version = "1.3"
|
|||||||
$zlib_link = "https://github.com/madler/zlib/archive/refs/tags/v$zlib_version.zip"
|
$zlib_link = "https://github.com/madler/zlib/archive/refs/tags/v$zlib_version.zip"
|
||||||
$zlib_output = "zlib.zip"
|
$zlib_output = "zlib.zip"
|
||||||
|
|
||||||
$libmpv_version = "20231220-git-17be6e1"
|
$libmpv_date = "2023-12-20"
|
||||||
$libmpv_link = "https://github.com/zhongfly/mpv-winbuild/releases/download/2023-12-11-566a96f/mpv-dev-x86_64-$libmpv_version.7z"
|
$libmpv_commit = "17be6e1"
|
||||||
|
$libmpv_version = "{0}-git-{1}"-f $libmpv_date.Replace("-", ""), $libmpv_commit
|
||||||
|
$libmpv_link = "https://github.com/zhongfly/mpv-winbuild/releases/download/$libmpv_date-$libmpv_commit/mpv-dev-x86_64-$libmpv_version.7z"
|
||||||
$libmpv_output = "mpv.zip"
|
$libmpv_output = "mpv.zip"
|
||||||
|
|
||||||
$ytdlp_version = "2023.11.16"
|
$ytdlp_version = "2023.11.16"
|
||||||
|
@ -441,7 +441,8 @@ bool LibMpvBackend::eventFilter(QObject* watched, QEvent* event) {
|
|||||||
|
|
||||||
if (event->type() == QEvent::Type::MouseMove && watched == this) {
|
if (event->type() == QEvent::Type::MouseMove && watched == this) {
|
||||||
auto* mouse_event = dynamic_cast<QMouseEvent*>(event);
|
auto* mouse_event = dynamic_cast<QMouseEvent*>(event);
|
||||||
auto position = mouse_event->pos();
|
auto scaling_ratio = window()->devicePixelRatio();
|
||||||
|
auto position = mouse_event->pos() * scaling_ratio;
|
||||||
auto x_str = QString::number(position.x()).toLocal8Bit();
|
auto x_str = QString::number(position.x()).toLocal8Bit();
|
||||||
auto y_str = QString::number(position.y()).toLocal8Bit();
|
auto y_str = QString::number(position.y()).toLocal8Bit();
|
||||||
const char* x = x_str.constData();
|
const char* x = x_str.constData();
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "gui/mediaplayer/libmpv/libmpvwidget.h"
|
#include "gui/mediaplayer/libmpv/libmpvwidget.h"
|
||||||
|
|
||||||
#include <QGuiApplication>
|
#include "miscellaneous/application.h"
|
||||||
|
|
||||||
#include <mpv/client.h>
|
#include <mpv/client.h>
|
||||||
|
|
||||||
@ -134,7 +134,11 @@ void LibMpvWidget::initializeGL() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LibMpvWidget::paintGL() {
|
void LibMpvWidget::paintGL() {
|
||||||
mpv_opengl_fbo mpfbo{static_cast<int>(defaultFramebufferObject()), width(), height(), 0};
|
auto scaling_ratio = window()->devicePixelRatio();
|
||||||
|
mpv_opengl_fbo mpfbo{static_cast<int>(defaultFramebufferObject()),
|
||||||
|
width() * scaling_ratio,
|
||||||
|
height() * scaling_ratio,
|
||||||
|
0};
|
||||||
int flip_y{1};
|
int flip_y{1};
|
||||||
|
|
||||||
mpv_render_param params[] = {{MPV_RENDER_PARAM_OPENGL_FBO, &mpfbo},
|
mpv_render_param params[] = {{MPV_RENDER_PARAM_OPENGL_FBO, &mpfbo},
|
||||||
|
@ -54,7 +54,9 @@ struct ITaskbarList4;
|
|||||||
struct GuiMessage {
|
struct GuiMessage {
|
||||||
public:
|
public:
|
||||||
GuiMessage() {}
|
GuiMessage() {}
|
||||||
GuiMessage(QString title, QString message, QSystemTrayIcon::MessageIcon type)
|
GuiMessage(QString title,
|
||||||
|
QString message,
|
||||||
|
QSystemTrayIcon::MessageIcon type = QSystemTrayIcon::MessageIcon::Information)
|
||||||
: m_title(std::move(title)), m_message(std::move(message)), m_type(type) {}
|
: m_title(std::move(title)), m_message(std::move(message)), m_type(type) {}
|
||||||
|
|
||||||
QString m_title;
|
QString m_title;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user