diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c index 5a073e8bba..d781204fe7 100644 --- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c +++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c @@ -6518,19 +6518,27 @@ _create_and_associate_transceivers_from_sdp (GstWebRTCBin * webrtc, if (trans_caps) { GstCaps *offer_caps = _rtp_caps_from_media (media); GstCaps *caps = gst_caps_intersect (offer_caps, trans_caps); - gst_caps_unref (offer_caps); - gst_caps_unref (trans_caps); if (caps) { if (!gst_caps_is_empty (caps)) { GST_LOG_OBJECT (webrtc, "found compatible transceiver %" GST_PTR_FORMAT " for offer media %u", trans, i); gst_caps_unref (caps); + gst_caps_unref (offer_caps); + gst_caps_unref (trans_caps); break; + } else { + GST_LOG_OBJECT (webrtc, + "tried but failed to intersect caps from" + " offer for m-line %d (%" GST_PTR_FORMAT + ") with caps from codec preferences and transceiver %" + GST_PTR_FORMAT, i, offer_caps, trans_caps); } gst_caps_unref (caps); caps = NULL; } + gst_caps_unref (offer_caps); + gst_caps_unref (trans_caps); } trans = NULL; }