webrtcbin: Don't assert if an SDP media can't be converted to caps

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1008
This commit is contained in:
Sebastian Dröge 2019-07-06 00:58:47 +03:00 committed by Sebastian Dröge
parent f5b1c75d4c
commit 329b2d3a6a
2 changed files with 11 additions and 0 deletions

View file

@ -2935,6 +2935,15 @@ _create_answer_task (GstWebRTCBin * webrtc, const GstStructure * options)
answer_dir = GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY;
answer_caps = gst_caps_ref (offer_caps);
}
if (gst_caps_is_empty (answer_caps)) {
GST_WARNING_OBJECT (webrtc, "Could not create caps for media");
if (rtp_trans)
gst_object_unref (rtp_trans);
gst_caps_unref (answer_caps);
goto rejected;
}
seen_transceivers = g_list_prepend (seen_transceivers, rtp_trans);
if (!rtp_trans) {

View file

@ -188,6 +188,8 @@ _rtp_caps_from_media (const GstSDPMedia * media)
GstCaps *caps;
caps = gst_sdp_media_get_caps_from_media (media, pt);
if (!caps)
continue;
/* gst_sdp_media_get_caps_from_media() produces caps with name
* "application/x-unknown" which will fail intersection with