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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1233>
This commit is contained in:
Mathieu Duponchelle 2023-05-19 14:47:45 +02:00 committed by Sebastian Dröge
parent b8b718fe62
commit 77f003f699

View file

@ -1684,7 +1684,7 @@ impl WebRTCSink {
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::<gst::Structure>(pspec.name()));
})