pipewire-pulse: delay create stream reply if the peer is not found

When the client adapter is configured in passthrough mode, the stream param
changed event in pipewire-pulse is emitted before the session manager creates
the link, and not after. Therfore, the peer can never be found when replying
create stream, and the pulseaudio application receives a stream error.

This patch delays the create stream reply until the link is added if the peer
cannot be found, fixing the above race conditon to allow passthrough mode to
work with pulseaudio applications.
This commit is contained in:
Julian Bouzas 2021-08-26 15:53:33 -04:00 committed by Wim Taymans
parent 60480f422e
commit b136bb8ca5
5 changed files with 353 additions and 326 deletions

View file

@ -50,6 +50,8 @@ void stream_free(struct stream *stream)
pw_log_debug("client %p: stream %p channel:%d", client, stream, stream->channel);
spa_list_remove(&stream->link);
if (stream->drain_tag)
reply_error(client, -1, stream->drain_tag, -ENOENT);