Deletion works
This commit is contained in:
parent
4796f6f5d7
commit
b2ef476445
1 changed files with 5 additions and 13 deletions
|
|
@ -104,6 +104,7 @@ bool PipeWireController::createVirtualDevice(const QString &name,
|
||||||
{ PW_KEY_MEDIA_CLASS, mediaClass },
|
{ PW_KEY_MEDIA_CLASS, mediaClass },
|
||||||
{ PW_KEY_AUDIO_CHANNELS, channelsBytes.constData() },
|
{ PW_KEY_AUDIO_CHANNELS, channelsBytes.constData() },
|
||||||
{ PW_KEY_AUDIO_RATE, rateBytes.constData() },
|
{ PW_KEY_AUDIO_RATE, rateBytes.constData() },
|
||||||
|
{ "object.linger", "true" },
|
||||||
{ PW_KEY_APP_NAME, "Potato-Manager" }
|
{ PW_KEY_APP_NAME, "Potato-Manager" }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -572,30 +573,21 @@ bool PipeWireController::destroyVirtualNode(uint32_t nodeId)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool destroyed = false;
|
|
||||||
lock();
|
lock();
|
||||||
|
|
||||||
for (auto it = m_virtualDevices.begin(); it != m_virtualDevices.end(); ) {
|
for (auto it = m_virtualDevices.begin(); it != m_virtualDevices.end(); ) {
|
||||||
struct pw_proxy *proxy = *it;
|
struct pw_proxy *proxy = *it;
|
||||||
if (proxy && pw_proxy_get_bound_id(proxy) == nodeId) {
|
if (proxy && pw_proxy_get_bound_id(proxy) == nodeId) {
|
||||||
pw_proxy_destroy(proxy);
|
|
||||||
it = m_virtualDevices.erase(it);
|
it = m_virtualDevices.erase(it);
|
||||||
destroyed = true;
|
|
||||||
} else {
|
} else {
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!destroyed) {
|
const int result = pw_registry_destroy(m_registry, nodeId);
|
||||||
auto *proxy = static_cast<struct pw_proxy*>(
|
|
||||||
pw_registry_bind(m_registry, nodeId, PW_TYPE_INTERFACE_Node, PW_VERSION_NODE, 0));
|
|
||||||
if (proxy) {
|
|
||||||
pw_proxy_destroy(proxy);
|
|
||||||
destroyed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
unlock();
|
unlock();
|
||||||
|
|
||||||
return destroyed;
|
return result == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
float PipeWireController::nodeMeterPeak(uint32_t nodeId) const
|
float PipeWireController::nodeMeterPeak(uint32_t nodeId) const
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue