diff --git a/source/player.cpp b/source/player.cpp index 800150f..412b8e4 100644 --- a/source/player.cpp +++ b/source/player.cpp @@ -231,9 +231,9 @@ void Player::initMpv() { mpv->observeProperty("window-scale", MPV_FORMAT_DOUBLE, [this](void* data) { double scale = static_cast(*(double*)data); - int w, h; - glfwGetWindowSize(window, &w, &h); - glfwSetWindowSize(window, (int)(w * scale), (int)(h * scale)); + int w = (int)mpv->property("dwidth"); + int h = (int)mpv->property("dheight"); + if (w > 0 && h > 0) glfwSetWindowSize(window, (int)(w * scale), (int)(h * scale)); }); mpv->observeProperty("fullscreen", MPV_FORMAT_FLAG, [this](void* data) {