diff --git a/0001-wfd-Always-touch-session-for-incoming-packets.patch b/0001-wfd-Always-touch-session-for-incoming-packets.patch new file mode 100644 index 0000000..7f14492 --- /dev/null +++ b/0001-wfd-Always-touch-session-for-incoming-packets.patch @@ -0,0 +1,57 @@ +From 6afa893c7f58ad3a511791ae1f55bca5584c3196 Mon Sep 17 00:00:00 2001 +From: Benjamin Berg +Date: Fri, 20 Dec 2019 15:00:05 +0100 +Subject: [PATCH] wfd: Always touch session for incoming packets + +It turns out that some adapters (specifically MS v2 adapters) do not +reply with the session ID for the keep-alive packet. In this case the +gstreamer RTSP server will not automatically touch the GstRTSPSession +and we will run into the session timeout. + +Fix this by simply touching all session for the client, for any received +response. + +See: #20 +--- + src/wfd/wfd-client.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/src/wfd/wfd-client.c b/src/wfd/wfd-client.c +index 38b385e..258d1d0 100644 +--- a/src/wfd/wfd-client.c ++++ b/src/wfd/wfd-client.c +@@ -275,11 +275,31 @@ wfd_client_idle_set_params (gpointer user_data) + return G_SOURCE_REMOVE; + } + ++GstRTSPFilterResult ++wfd_client_touch_session_filter_func (GstRTSPClient *client, ++ GstRTSPSession *sess, ++ gpointer user_data) ++{ ++ gst_rtsp_session_touch (sess); ++ ++ return GST_RTSP_FILTER_KEEP; ++} ++ + void + wfd_client_handle_response (GstRTSPClient * client, GstRTSPContext *ctx) + { + WfdClient *self = WFD_CLIENT (client); + ++ /* Some sinks do not reply with the correct session-id. Which causes ++ * gst-rtsp-server to not touch the session, triggering a timeout ++ * even though the sink actually replied. ++ * ++ * Work around this by explicitly touching the session (again). And ++ * to do that, just touch all of them, which is acceptable as we will ++ * only have one. ++ */ ++ gst_rtsp_client_session_filter (client, wfd_client_touch_session_filter_func, NULL); ++ + /* Track the initialization process and possibly trigger the + * next state of the connection establishment. */ + switch (self->init_state) +-- +2.24.1 + diff --git a/gnome-network-displays.spec b/gnome-network-displays.spec index 26241c6..0b13ec4 100644 --- a/gnome-network-displays.spec +++ b/gnome-network-displays.spec @@ -1,6 +1,6 @@ Name: gnome-network-displays Version: 0.90.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Stream the desktop to Wi-Fi Display capable devices # The icon is licensed CC-BY-SA @@ -27,6 +27,8 @@ Requires: gtk3 Requires: hicolor-icon-theme Requires: NetworkManager-wifi +Patch0: 0001-wfd-Always-touch-session-for-incoming-packets.patch + %description GNOME Network Displays allows you to cast your desktop to a remote display. Currently implemented is support for casting to Wi-Fi Display capable devices @@ -56,6 +58,10 @@ appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.appdata.xml %{_metainfodir}/org.gnome.NetworkDisplays.appdata.xml %changelog +* Fri Dec 20 2019 Benjamin Berg - 0.90.2-2 +- Add patch to prevent timeout with certain sinks + https://github.com/benzea/gnome-network-displays/issues/20 + * Mon Dec 16 2019 Benjamin Berg - 0.90.2-1 - New upstream release 0.90.2 with bugfixes