webrtc SDP RTX processing bug with no ssrc
@thaytan
Submitted by Jan Schmidt Link to original bug (#796810)
Description
The unit test for webrtc encounters a case where it uses an uninitialised variable here in sdp_media_from_transceiver(), because the caps it generates for type == GST_WEBRTC_SDP_TYPE_OFFER don't contain an ssrc.
This patch adds a warning when that happens, but I'm not sure why it's happening:
diff --git a/ext/webrtc/gstwebrtcbin.c b/ext/webrtc/gstwebrtcbin.c
index 9baebede3..ffe0bb1c7 100644
--- a/ext/webrtc/gstwebrtcbin.c
+++ b/ext/webrtc/gstwebrtcbin.c
@@ -1701,15 +1701,17 @@ sdp_media_from_transceiver (GstWebRTCBin * webrtc, GstSDPMedia * media,
gint clockrate = -1;
gint rtx_target_pt;
gint original_rtx_target_pt; /* Workaround chrome bug: https://bugs.chromium.org/p/webrtc/issues/detail?id=6196 */
- guint rtx_target_ssrc;
-
guint rtx_target_ssrc = -1;
if (gst_structure_get_int (s, "payload", &rtx_target_pt))
g_array_append_val (reserved_pts, rtx_target_pt);original_rtx_target_pt = rtx_target_pt;
- gst_structure_get_int (s, "clock-rate", &clockrate);
- gst_structure_get_uint (s, "ssrc", &rtx_target_ssrc);
-
if (!gst_structure_get_int (s, "clock-rate", &clockrate))
-
GST_WARNING_OBJECT (webrtc, "Caps %" GST_PTR_FORMAT " are missing clock-rate", caps);
-
if (!gst_structure_get_uint (s, "ssrc", &rtx_target_ssrc))
-
GST_WARNING_OBJECT (webrtc, "Caps %" GST_PTR_FORMAT " are missing ssrc", caps);
_pick_fec_payload_types (webrtc, WEBRTC_TRANSCEIVER (trans), reserved_pts,
clockrate, &rtx_target_pt, media);
Here's the warning:
0:00:00.874198556 16302 0x1976720 WARN webrtcbin gstwebrtcbin.c:1714:sdp_media_from_transceiver:<webrtcbin0>
Caps application/x-rtp, payload=(int)96, encoding-name=(string)OPUS, media=(string)audio, clock-rate=(int)48000, rtcp-fb-nack-pli=(boolean)true are missing ssrc