Skip to content

Commit

Permalink
trim device names before comparing
Browse files Browse the repository at this point in the history
  • Loading branch information
radj307 committed Jul 30, 2022
1 parent 2ab1b0a commit 5209073
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vccli/AudioAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,9 @@ namespace vccli {
dev->GetId(&sbuf);
std::string deviceID{ w_converter.to_bytes(sbuf) };

const auto& deviceName{ getDeviceFriendlyName(dev) };
const auto& deviceName{ str::trim(getDeviceFriendlyName(dev)) };

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

0 comments on commit 5209073

Please sign in to comment.