summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2018-07-14 23:15:02 +1000
committerJan Schmidt <jan@centricular.com>2018-07-15 23:07:21 +1000
commite6a564216d9adabf11e99a1cdbe6c20545d1dd57 (patch)
treed4b1872c013eadfce4ceae720a7a90cc2bcae651 /ext
parent76a93da2a7786c131d88a606cb10c842441641e8 (diff)
downloadgstreamer-plugins-bad-e6a564216d9adabf11e99a1cdbe6c20545d1dd57.tar.gz
webrtc: Add a warning in sdp_media_from_transceiver()
When generating caps with no ssrc, at least throw a warning instead of using an uninitialised stack variable https://bugzilla.gnome.org/show_bug.cgi?id=796810
Diffstat (limited to 'ext')
-rw-r--r--ext/webrtc/gstwebrtcbin.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/webrtc/gstwebrtcbin.c b/ext/webrtc/gstwebrtcbin.c
index 888c5135e..6c8674846 100644
--- a/ext/webrtc/gstwebrtcbin.c
+++ b/ext/webrtc/gstwebrtcbin.c
@@ -1704,15 +1704,19 @@ 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);