mirror of
https://github.com/rust-vmm/vhost-device.git
synced 2025-12-31 11:29:37 +00:00
sound/pipewire: move stream_hash insert into lock
Inserting a new stream into stream_hash can potentially move out of context a stream previously stored in the hash with the same id, triggering pw::stream::Stream::Drop, which calls pw_stream_destroy. As calls to the pipewire library must happen either in the pipewire thread or under thread_loop lock protection, move the insert into stream_hash under the latter. Signed-off-by: Sergio Lopez <slp@redhat.com>
This commit is contained in:
parent
e906351003
commit
c9c86bd9aa
@ -385,10 +385,10 @@ impl AudioBackend for PwBackend {
|
||||
)
|
||||
.expect("could not connect to the stream");
|
||||
|
||||
lock_guard.unlock();
|
||||
|
||||
// insert created stream in a hash table
|
||||
stream_hash.insert(stream_id, stream);
|
||||
|
||||
lock_guard.unlock();
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user