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
This commit is contained in:
Wim Taymans 2020-08-04 18:13:37 +02:00
parent 94c23b7ed1
commit 979fec288e

View file

@ -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);
}