fix scaling problem in libmpv + fix url of libmpv

This commit is contained in:
Martin Rotter 2023-12-21 15:31:09 +01:00
parent 5a10a24a19
commit 0edb3ca104
4 changed files with 15 additions and 6 deletions

View File

@ -48,8 +48,10 @@ $zlib_version = "1.3"
$zlib_link = "https://github.com/madler/zlib/archive/refs/tags/v$zlib_version.zip"
$zlib_output = "zlib.zip"
$libmpv_version = "20231220-git-17be6e1"
$libmpv_link = "https://github.com/zhongfly/mpv-winbuild/releases/download/2023-12-11-566a96f/mpv-dev-x86_64-$libmpv_version.7z"
$libmpv_date = "2023-12-20"
$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"
$ytdlp_version = "2023.11.16"

View File

@ -441,7 +441,8 @@ bool LibMpvBackend::eventFilter(QObject* watched, QEvent* event) {
if (event->type() == QEvent::Type::MouseMove && watched == this) {
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 y_str = QString::number(position.y()).toLocal8Bit();
const char* x = x_str.constData();

View File

@ -2,7 +2,7 @@
#include "gui/mediaplayer/libmpv/libmpvwidget.h"
#include <QGuiApplication>
#include "miscellaneous/application.h"
#include <mpv/client.h>
@ -134,7 +134,11 @@ void LibMpvWidget::initializeGL() {
}
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};
mpv_render_param params[] = {{MPV_RENDER_PARAM_OPENGL_FBO, &mpfbo},

View File

@ -54,7 +54,9 @@ struct ITaskbarList4;
struct GuiMessage {
public:
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) {}
QString m_title;