1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

Qt: Fix camera id and format when default is selected

This commit is contained in:
Megamouse 2024-07-08 18:10:01 +02:00
parent 441b324afe
commit 7ea64b53ad

View File

@ -298,13 +298,16 @@ void qt_camera_handler::update_camera_settings()
// Update camera if possible. We can only do this if it is already loaded.
if (m_camera && m_camera->isAvailable())
{
// Get camera id. Use camera id of Qt default if the "Default" camera is selected.
const std::string camera_id = (m_camera_id == g_cfg.io.camera_id.def) ? QMediaDevices::defaultVideoInput().id().toStdString() : m_camera_id;
// Load selected settings from config file
bool success = false;
cfg_camera::camera_setting cfg_setting = g_cfg_camera.get_camera_setting(m_camera_id, success);
cfg_camera::camera_setting cfg_setting = g_cfg_camera.get_camera_setting(camera_id, success);
if (success)
{
camera_log.notice("Found config entry for camera \"%s\"", m_camera_id);
camera_log.notice("Found config entry for camera \"%s\" (m_camera_id='%s')", camera_id, m_camera_id);
// List all available settings and choose the proper value if possible.
const double epsilon = 0.001;