From 7171a4179655fe1873f2baf49fae647243cfc8a0 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Thu, 16 Feb 2023 18:01:31 +0100 Subject: [PATCH] screen-cast/src: Do not close streams on error Streams are generally recoverable by the client and errors may happen e.g. on negotiation failures. Right now we close the stream and corresponding session, which is neither necessary nor expected by clients. Just disable the stream instead and let clients handle things as they seem fit. This allows clients to e.g. try several Gstreamer pipelines with limited caps on a single stream. Part-of: --- src/backends/meta-screen-cast-stream-src.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backends/meta-screen-cast-stream-src.c b/src/backends/meta-screen-cast-stream-src.c index 9412014ea..9f57385e9 100644 --- a/src/backends/meta-screen-cast-stream-src.c +++ b/src/backends/meta-screen-cast-stream-src.c @@ -801,8 +801,8 @@ on_stream_state_changed (void *data, switch (state) { case PW_STREAM_STATE_ERROR: - g_warning ("pipewire stream error: %s", error_message); - meta_screen_cast_stream_src_close (src); + if (meta_screen_cast_stream_src_is_enabled (src)) + meta_screen_cast_stream_src_disable (src); break; case PW_STREAM_STATE_PAUSED: if (priv->node_id == SPA_ID_INVALID && priv->pipewire_stream)