From 1f5396fedbfbb1d551f944b6c4d932c3909068d6 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 14 Oct 2021 16:00:40 +0200 Subject: [PATCH] stream: don't change to the error state on proxy errors The proxy errors are really from the session manager informing us about decisions it made (failure to link, etc). The state of the stream is not really affected by this so just emit the error signal and let the app decide what to do. --- src/pipewire/filter.c | 6 +++++- src/pipewire/stream.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pipewire/filter.c b/src/pipewire/filter.c index e87abadfe..9a65bcf46 100644 --- a/src/pipewire/filter.c +++ b/src/pipewire/filter.c @@ -1144,7 +1144,11 @@ static void proxy_destroy(void *_data) static void proxy_error(void *_data, int seq, int res, const char *message) { struct pw_filter *filter = _data; - filter_set_state(filter, PW_FILTER_STATE_ERROR, message); + /* we just emit the state change here to inform the application. + * If this is supposed to be a permanent error, the app should + * do a pw_stream_set_error() */ + pw_filter_emit_state_changed(filter, filter->state, + PW_FILTER_STATE_ERROR, message); } static void proxy_bound(void *_data, uint32_t global_id) diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index 2456265af..f5ae3a53f 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -1014,7 +1014,11 @@ static void proxy_destroy(void *_data) static void proxy_error(void *_data, int seq, int res, const char *message) { struct pw_stream *stream = _data; - stream_set_state(stream, PW_STREAM_STATE_ERROR, message); + /* we just emit the state change here to inform the application. + * If this is supposed to be a permanent error, the app should + * do a pw_stream_set_error() */ + pw_stream_emit_state_changed(stream, stream->state, + PW_STREAM_STATE_ERROR, message); } static void proxy_bound(void *data, uint32_t global_id)