From 979fec288e2c02ab71bb802460bc1c835c0e5910 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 4 Aug 2020 18:13:37 +0200 Subject: stream: let the operation emit the TERMINATED state When we disconnect, let the operation emit the TERMINATED state because some apps expect this state to be emited asynchronously. Makes GStreamer pulsesink work. Fixes #210 --- pipewire-pulseaudio/src/stream.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pipewire-pulseaudio/src/stream.c b/pipewire-pulseaudio/src/stream.c index d44e00c6..2bf351de 100644 --- a/pipewire-pulseaudio/src/stream.c +++ b/pipewire-pulseaudio/src/stream.c @@ -112,8 +112,6 @@ static void stream_state_changed(void *data, enum pw_stream_state old, if (!s->disconnecting) { pa_context_set_error(c, PA_ERR_KILLED); pa_stream_set_state(s, PA_STREAM_FAILED); - } else { - pa_stream_set_state(s, PA_STREAM_TERMINATED); } break; case PW_STREAM_STATE_CONNECTING: @@ -1020,6 +1018,7 @@ int pa_stream_connect_record( static void on_disconnected(pa_operation *o, void *userdata) { pa_stream *s = o->stream; + pw_log_debug("stream %p", s); pa_stream_set_state(s, PA_STREAM_TERMINATED); } -- cgit v1.2.3