win-dshow: Avoid redundant string conversions

We were going from wstring -> wchar_t * -> wstring. Issue detected by
PVS Studio.
This commit is contained in:
Richard Stanway 2021-08-18 23:40:49 +02:00
parent 486380e2c3
commit 4bf81e9bf6

View File

@ -932,8 +932,8 @@ bool DShowInput::UpdateVideoConfig(obs_data_t *settings)
interval = best_interval;
}
videoConfig.name = id.name.c_str();
videoConfig.path = id.path.c_str();
videoConfig.name = id.name;
videoConfig.path = id.path;
videoConfig.useDefaultConfig = resType == ResType_Preferred;
videoConfig.cx = cx;
videoConfig.cy_abs = abs(cy);
@ -1000,8 +1000,8 @@ bool DShowInput::UpdateAudioConfig(obs_data_t *settings)
if (!DecodeDeviceId(id, audio_device_id.c_str()))
return false;
audioConfig.name = id.name.c_str();
audioConfig.path = id.path.c_str();
audioConfig.name = id.name;
audioConfig.path = id.path;
} else if (!deviceHasAudio) {
return true;