diff options
author | Mathieu Duponchelle <mathieu@centricular.com> | 2023-11-24 21:53:38 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2023-12-18 11:27:16 +0300 |
commit | 630a1120ba36d6ec2c992d771ca3a8ed11994475 (patch) | |
tree | 46fad14f94b309edaa689d166c1b32000f51d6ae | |
parent | 55d2b9483cb8f15c772833bd9d95b5c7e64ea472 (diff) |
webrtcsink: don't panic on failure to request pad from webrtcbin
webrtcbin will refuse pad requests for all sorts of reasons, and should
be logging an error when doing so, simply post an error message and let
the application deal with it, the reason for the refusal should
hopefully be available in the logs to the user.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1411>
-rw-r--r-- | net/webrtc/src/webrtcsink/imp.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/net/webrtc/src/webrtcsink/imp.rs b/net/webrtc/src/webrtcsink/imp.rs index c758f9483..9762d5d14 100644 --- a/net/webrtc/src/webrtcsink/imp.rs +++ b/net/webrtc/src/webrtcsink/imp.rs @@ -1142,10 +1142,20 @@ impl Session { payloader_caps ); - let pad = self + let pad = if let Some(pad) = self .webrtcbin .request_pad_simple(&format!("sink_{}", media_idx)) - .unwrap(); + { + pad + } else { + gst::error!(CAT, obj: element, "Failed to request pad from webrtcbin"); + gst::element_error!( + element, + gst::StreamError::Failed, + ["Failed to request pad from webrtcbin"] + ); + return; + }; let transceiver = pad.property::<gst_webrtc::WebRTCRTPTransceiver>("transceiver"); |