Fix really terrible code
This commit is contained in:
parent
146b2d62e0
commit
e53e7bc600
1 changed files with 5 additions and 7 deletions
|
@ -409,14 +409,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)) {
|
auto sinkListIterator = this->sinkList.find(name);
|
||||||
// unregister ControlChangeNotify before doing any changes to a sink
|
if (sinkListIterator != this->sinkList.end()) {
|
||||||
HRESULT unregisterSuccess = E_POINTER;
|
|
||||||
auto sinkListIterator = this->sinkList.find(name);
|
|
||||||
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;
|
||||||
|
|
Loading…
Reference in a new issue