Fix really terrible code

This commit is contained in:
Albert Vaca Cintora 2023-05-25 13:08:10 +02:00
parent 4510762af5
commit d618bac26c

View file

@ -413,14 +413,12 @@ bool SystemvolumePlugin::receivePacket(const NetworkPacket &np)
} else { } else {
QString name = np.get<QString>(QStringLiteral("name")); QString name = np.get<QString>(QStringLiteral("name"));
if (sinkList.contains(name)) {
// unregister ControlChangeNotify before doing any changes to a sink
HRESULT unregisterSuccess = E_POINTER;
auto sinkListIterator = this->sinkList.find(name); auto sinkListIterator = this->sinkList.find(name);
if (sinkListIterator != this->sinkList.end()) {
auto &sink = sinkListIterator.value(); auto &sink = sinkListIterator.value();
if (!(sinkListIterator == this->sinkList.end())) {
unregisterSuccess = sink.first->UnregisterControlChangeNotify(sink.second); // unregister ControlChangeNotify before doing any changes to a sink
} HRESULT unregisterSuccess = sink.first->UnregisterControlChangeNotify(sink.second);
if (np.has(QStringLiteral("volume"))) { if (np.has(QStringLiteral("volume"))) {
float currentVolume; float currentVolume;