mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pulse-server: send any STREAM_KILLED command last
Mark the stream as killed and then only send the STREAM_KILLED command after we send the other pending commands.
This commit is contained in:
parent
6b6bf1e1d0
commit
80a6583271
1 changed files with 5 additions and 1 deletions
|
|
@ -241,6 +241,7 @@ struct stream {
|
|||
unsigned int is_underrun:1;
|
||||
unsigned int in_prebuf:1;
|
||||
unsigned int done:1;
|
||||
unsigned int killed:1;
|
||||
};
|
||||
|
||||
struct server {
|
||||
|
|
@ -1118,6 +1119,9 @@ static void stream_free(struct stream *stream)
|
|||
if (stream->drain_tag)
|
||||
reply_error(client, -1, stream->drain_tag, -ENOENT);
|
||||
|
||||
if (stream->killed)
|
||||
send_stream_killed(stream);
|
||||
|
||||
/* force processing of all pending messages before we destroy
|
||||
* the stream */
|
||||
pw_loop_invoke(impl->loop, NULL, 0, NULL, 0, false, client);
|
||||
|
|
@ -1541,7 +1545,7 @@ static void stream_state_changed(void *data, enum pw_stream_state old,
|
|||
break;
|
||||
case PW_STREAM_STATE_UNCONNECTED:
|
||||
if (!client->disconnecting)
|
||||
send_stream_killed(stream);
|
||||
stream->killed = true;
|
||||
stream->done = true;
|
||||
break;
|
||||
case PW_STREAM_STATE_CONNECTING:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue