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/1234>
This commit is contained in:
Mathieu Duponchelle 2023-05-19 14:47:45 +02:00 committed by Sebastian Dröge
parent d2947ed1f3
commit 8ff2c6609c

View file

@ -1655,7 +1655,7 @@ impl WebRTCSink {
if let Some(mut session) = state.sessions.get_mut(&session_id_str) { if let Some(mut session) = state.sessions.get_mut(&session_id_str) {
session.stats_sigid = Some(rtp_session.connect_notify(Some("twcc-stats"), 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 // 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())); element.imp().process_loss_stats(&element, &session_id_str, &sess.property::<gst::Structure>(pspec.name()));
}) })