From ccf076ed1e36f4a56f96c394b3bd11d38763dd3c Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Fri, 19 May 2023 14:47:45 +0200 Subject: [PATCH] webrtcsink: don't panic in twcc-stats callback If webrtcbin was disposed of at this point, simply return Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/345 Part-of: --- net/webrtc/src/webrtcsink/imp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/webrtc/src/webrtcsink/imp.rs b/net/webrtc/src/webrtcsink/imp.rs index 42b36474..ba2cbd2b 100644 --- a/net/webrtc/src/webrtcsink/imp.rs +++ b/net/webrtc/src/webrtcsink/imp.rs @@ -2203,7 +2203,7 @@ impl BaseWebRTCSink { if let Some(session) = state.sessions.get_mut(&session_id_str) { session.stats_sigid = Some(rtp_session.connect_notify(Some("twcc-stats"), - glib::clone!(@strong session_id_str, @weak webrtcbin, @weak element => @default-panic, move |sess, pspec| { + glib::clone!(@strong session_id_str, @weak webrtcbin, @weak element => @default-return (), move |sess, pspec| { // Run the Loss-based control algorithm on new peer TWCC feedbacks element.imp().process_loss_stats(&element, &session_id_str, &sess.property::(pspec.name())); })