Qt: Fix record A/V window not updating resolution (fixes #1626)
Vicki Pfau vi@endrift.com
Mon, 20 Jan 2020 18:21:37 -0800
2 files changed,
12 insertions(+),
4 deletions(-)
M
CHANGES
→
CHANGES
@@ -115,6 +115,7 @@ - Qt: Fix sprite view using wrong base address (fixes mgba.io/i/1603)
- Qt: Fix inability to clear default keybindings - Qt: Release held actions if they get rebound - Qt: Fix crash double-clicking menus in shortcut settings (fixes mgba.io/i/1627) + - Qt: Fix record A/V window not updating resolution (fixes mgba.io/i/1626) - Vita: Fix analog controls (fixes mgba.io/i/1554) - Wii: Fix game fast-forwarding after slowing down - Wii: Improve audio buffering (fixes mgba.io/i/1617)
M
src/platform/qt/VideoView.cpp
→
src/platform/qt/VideoView.cpp
@@ -197,11 +197,15 @@ free(m_containerCstr);
} void VideoView::setController(std::shared_ptr<CoreController> controller) { - connect(controller.get(), &CoreController::stopping, this, &VideoView::stopRecording); - connect(this, &VideoView::recordingStarted, controller.get(), &CoreController::setAVStream); - connect(this, &VideoView::recordingStopped, controller.get(), &CoreController::clearAVStream, Qt::DirectConnection); + CoreController* controllerPtr = controller.get(); + connect(controllerPtr, &CoreController::frameAvailable, this, [this, controllerPtr]() { + setNativeResolution(controllerPtr->screenDimensions()); + }); + connect(controllerPtr, &CoreController::stopping, this, &VideoView::stopRecording); + connect(this, &VideoView::recordingStarted, controllerPtr, &CoreController::setAVStream); + connect(this, &VideoView::recordingStopped, controllerPtr, &CoreController::clearAVStream, Qt::DirectConnection); - setNativeResolution(controller->screenDimensions()); + setNativeResolution(controllerPtr->screenDimensions()); } void VideoView::startRecording() {@@ -225,6 +229,9 @@ validateSettings();
} void VideoView::setNativeResolution(const QSize& dims) { + if (dims.width() == m_nativeWidth && dims.height() == m_nativeHeight) { + return; + } m_nativeWidth = dims.width(); m_nativeHeight = dims.height(); m_ui.presetNative->setText(tr("Native (%0x%1)").arg(m_nativeWidth).arg(m_nativeHeight));