[SystemVolumePlugin][Windows] Fixed sink callback registration condition

This commit is contained in:
Art Pinch 2020-11-24 18:07:37 +03:00 committed by Piyush Aggarwal
parent b5ac96ce5b
commit 8a5858a903

View file

@ -312,13 +312,13 @@ bool SystemvolumePlugin::sendSinkList()
sinkObject.insert(QStringLiteral("maxVolume"), (qint64)100); sinkObject.insert(QStringLiteral("maxVolume"), (qint64)100);
// Register Callback // Register Callback
QString qDeviceId = QString::fromWCharArray(deviceId); if (!sinkList.contains(name)) {
if (!sinkList.contains(qDeviceId)) {
callback = new CAudioEndpointVolumeCallback(*this, name); callback = new CAudioEndpointVolumeCallback(*this, name);
endpoint->RegisterControlChangeNotify(callback); endpoint->RegisterControlChangeNotify(callback);
sinkList[name] = qMakePair(endpoint, callback); sinkList[name] = qMakePair(endpoint, callback);
} }
QString qDeviceId = QString::fromWCharArray(deviceId);
idToNameMap[qDeviceId] = name; idToNameMap[qDeviceId] = name;
device->Release(); device->Release();