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_AUDIO_CHANNELS, channelsBytes.constData() },
|
||||
{ PW_KEY_AUDIO_RATE, rateBytes.constData() },
|
||||
{ "object.linger", "true" },
|
||||
{ PW_KEY_APP_NAME, "Potato-Manager" }
|
||||
};
|
||||
|
||||
|
|
@ -572,30 +573,21 @@ bool PipeWireController::destroyVirtualNode(uint32_t nodeId)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool destroyed = false;
|
||||
lock();
|
||||
|
||||
for (auto it = m_virtualDevices.begin(); it != m_virtualDevices.end(); ) {
|
||||
struct pw_proxy *proxy = *it;
|
||||
if (proxy && pw_proxy_get_bound_id(proxy) == nodeId) {
|
||||
pw_proxy_destroy(proxy);
|
||||
it = m_virtualDevices.erase(it);
|
||||
destroyed = true;
|
||||
} else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
if (!destroyed) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
const int result = pw_registry_destroy(m_registry, nodeId);
|
||||
unlock();
|
||||
|
||||
return destroyed;
|
||||
return result == 0;
|
||||
}
|
||||
|
||||
float PipeWireController::nodeMeterPeak(uint32_t nodeId) const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue