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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2850>
This commit is contained in:
Robert Mader 2023-02-16 18:01:31 +01:00 committed by Marge Bot
parent c6b454d00f
commit 7171a41796

View File

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