diff --git a/CHANGES b/CHANGES index 03eb606a4..e4d944d11 100644 --- a/CHANGES +++ b/CHANGES @@ -65,6 +65,7 @@ Other fixes: - Qt: Fix a race condition in the frame inspector - Qt: Add dummy English translation file (fixes mgba.io/i/1469) - Qt: Fix Battle Chip view not displaying chips on some DPI settings + - Qt: Fix camera image being upside-down sometimes (fixes mgba.io/i/829 again) - mGUI: Fix closing down a game if an exit is signalled - mVL: Fix injecting accidentally draining non-injection buffer - SM83: Simplify register pair access on big endian diff --git a/src/platform/qt/VideoDumper.cpp b/src/platform/qt/VideoDumper.cpp index c5df8d208..392030277 100644 --- a/src/platform/qt/VideoDumper.cpp +++ b/src/platform/qt/VideoDumper.cpp @@ -6,6 +6,7 @@ #include "VideoDumper.h" #include +#include using namespace QGBA; @@ -40,13 +41,11 @@ bool VideoDumper::present(const QVideoFrame& frame) { QImage image(bits, mappedFrame.width(), mappedFrame.height(), mappedFrame.bytesPerLine(), format); if (swap) { image = image.rgbSwapped(); - } else { -#ifdef Q_OS_WIN - // Qt's DirectShow plug-in is pretty dang buggy - image = image.mirrored(); -#else + } else if (surfaceFormat().scanLineDirection() != QVideoSurfaceFormat::BottomToTop) { image = image.copy(); // Create a deep copy of the bits -#endif + } + if (surfaceFormat().scanLineDirection() == QVideoSurfaceFormat::BottomToTop) { + image = image.mirrored(); } mappedFrame.unmap(); emit imageAvailable(image);