webrtcbin: Move addition of attributes to the caps after making sure they're not empty or any

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1291>
This commit is contained in:
Sebastian Dröge 2021-11-04 12:45:34 +02:00 committed by GStreamer Marge Bot
parent d628ccf0e5
commit 30153f1591

View file

@ -2848,8 +2848,6 @@ sdp_media_from_transceiver (GstWebRTCBin * webrtc, GstSDPMedia * media,
g_free (direction);
caps = _find_codec_preferences (webrtc, trans, media_idx, error);
caps = _add_supported_attributes_to_caps (webrtc, WEBRTC_TRANSCEIVER (trans),
caps);
if (!caps || gst_caps_is_empty (caps) || gst_caps_is_any (caps)) {
GST_WARNING_OBJECT (webrtc, "no caps available for transceiver, skipping");
@ -2858,6 +2856,9 @@ sdp_media_from_transceiver (GstWebRTCBin * webrtc, GstSDPMedia * media,
return FALSE;
}
caps = _add_supported_attributes_to_caps (webrtc, WEBRTC_TRANSCEIVER (trans),
caps);
for (i = 0; i < gst_caps_get_size (caps); i++) {
GstCaps *format = gst_caps_new_empty ();
const GstStructure *s = gst_caps_get_structure (caps, i);