Skip to content

Commit 5209073

Browse files
committed
trim device names before comparing
1 parent 2ab1b0a commit 5209073

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vccli/AudioAPI.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,9 @@ namespace vccli {
343343
dev->GetId(&sbuf);
344344
std::string deviceID{ w_converter.to_bytes(sbuf) };
345345

346-
const auto& deviceName{ getDeviceFriendlyName(dev) };
346+
const auto& deviceName{ str::trim(getDeviceFriendlyName(dev)) };
347347

348-
if (!target_pid.has_value() && (str::tolower(deviceID) == target_id_lower || str::tolower(deviceName) == target_id_lower)) {
348+
if (!target_pid.has_value() && (target_id_lower == str::tolower(deviceID) || target_id_lower == str::tolower(deviceName))) {
349349
IAudioEndpointVolume* endpointVolume{};
350350
dev->Activate(__uuidof(IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL, (void**)&endpointVolume);
351351
object = std::make_unique<EndpointVolume>(endpointVolume, deviceName, getDeviceDataFlow(dev));

0 commit comments

Comments
 (0)