From a15e4e80c695e8a5976418c333a99b610f3b6d9d Mon Sep 17 00:00:00 2001 From: zhupengfei Date: Thu, 7 Jun 2018 12:59:18 +0800 Subject: [PATCH] QtMultimediaCamera: fix invalid settings --- src/citra_qt/camera/qt_multimedia_camera.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/citra_qt/camera/qt_multimedia_camera.cpp b/src/citra_qt/camera/qt_multimedia_camera.cpp index ad6bad876f..76a21453d6 100644 --- a/src/citra_qt/camera/qt_multimedia_camera.cpp +++ b/src/citra_qt/camera/qt_multimedia_camera.cpp @@ -93,8 +93,10 @@ void QtMultimediaCamera::SetFrameRate(Service::CAM::FrameRate frame_rate) { auto framerate = FrameRateList[static_cast(frame_rate)]; - handler->settings.setMinimumFrameRate(framerate.minimumFrameRate); - handler->settings.setMaximumFrameRate(framerate.maximumFrameRate); + if (handler->camera->supportedViewfinderFrameRateRanges().contains(framerate)) { + handler->settings.setMinimumFrameRate(framerate.minimumFrameRate); + handler->settings.setMaximumFrameRate(framerate.maximumFrameRate); + } } QImage QtMultimediaCamera::QtReceiveFrame() { @@ -171,6 +173,7 @@ void QtMultimediaCameraHandler::CreateCamera(const std::string& camera_name) { settings.setMinimumFrameRate(30); settings.setMaximumFrameRate(30); camera->setViewfinder(&camera_surface); + camera->load(); } void QtMultimediaCameraHandler::StopCamera() {