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
This commit is contained in:
Jan Schmidt 2018-07-14 23:15:02 +10:00
parent 76a93da2a7
commit e6a564216d

View file

@ -1704,15 +1704,19 @@ sdp_media_from_transceiver (GstWebRTCBin * webrtc, GstSDPMedia * media,
gint clockrate = -1; gint clockrate = -1;
gint rtx_target_pt; gint rtx_target_pt;
gint original_rtx_target_pt; /* Workaround chrome bug: https://bugs.chromium.org/p/webrtc/issues/detail?id=6196 */ 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)) if (gst_structure_get_int (s, "payload", &rtx_target_pt))
g_array_append_val (reserved_pts, rtx_target_pt); g_array_append_val (reserved_pts, rtx_target_pt);
original_rtx_target_pt = rtx_target_pt; original_rtx_target_pt = rtx_target_pt;
gst_structure_get_int (s, "clock-rate", &clockrate); if (!gst_structure_get_int (s, "clock-rate", &clockrate))
gst_structure_get_uint (s, "ssrc", &rtx_target_ssrc); 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, _pick_fec_payload_types (webrtc, WEBRTC_TRANSCEIVER (trans), reserved_pts,
clockrate, &rtx_target_pt, media); clockrate, &rtx_target_pt, media);