diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index 922ec5bf8..f0cb55da6 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -1164,16 +1164,16 @@ static void stream_state_changed(void *data, enum pw_stream_state old, break; } - /* Don't emit suspended if we are creating a corked stream, as that will have a quick - * RUNNING/SUSPENDED transition for initial negotiation */ + /* Only emit suspended if we are created and not a corked stream, this means the + * paused on our stream needs to be caused by the sink suspend or an unlink. */ if (stream->create_tag == SPA_ID_INVALID && !stream->corked) { if (old == PW_STREAM_STATE_PAUSED && state == PW_STREAM_STATE_STREAMING && - stream->is_suspended) { + stream->dont_inhibit_auto_suspend && stream->is_suspended) { stream_send_suspended(stream, false); stream->is_suspended = false; } if (old == PW_STREAM_STATE_STREAMING && state == PW_STREAM_STATE_PAUSED && - !stream->is_suspended) { + stream->dont_inhibit_auto_suspend && !stream->is_suspended) { if (stream->fail_on_suspend) { stream->killed = true; destroy_stream = true; @@ -1790,6 +1790,7 @@ static int do_create_playback_stream(struct client *client, uint32_t command, ui stream->is_underrun = true; stream->underrun_for = -1; stream->fail_on_suspend = fail_on_suspend; + stream->dont_inhibit_auto_suspend = dont_inhibit_auto_suspend; pw_properties_set(props, "pulse.corked", corked ? "true" : "false"); @@ -2066,6 +2067,7 @@ static int do_create_record_stream(struct client *client, uint32_t command, uint stream->muted = muted; stream->muted_set = muted_set; stream->fail_on_suspend = fail_on_suspend; + stream->dont_inhibit_auto_suspend = dont_inhibit_auto_suspend; if (client->quirks & QUIRK_REMOVE_CAPTURE_DONT_MOVE) no_move = false; diff --git a/src/modules/module-protocol-pulse/stream.h b/src/modules/module-protocol-pulse/stream.h index 022f0ee74..f5609da6b 100644 --- a/src/modules/module-protocol-pulse/stream.h +++ b/src/modules/module-protocol-pulse/stream.h @@ -101,6 +101,7 @@ struct stream { unsigned int is_paused:1; unsigned int fail_on_suspend:1; unsigned int is_suspended:1; + unsigned int dont_inhibit_auto_suspend:1; }; struct stream *stream_new(struct client *client, enum stream_type type, uint32_t create_tag,