webrtcbin: Move addition of attributes to the caps after making sure they're not...
authorSebastian Dröge <sebastian@centricular.com>
Thu, 4 Nov 2021 10:45:34 +0000 (12:45 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 4 Nov 2021 10:51:15 +0000 (10:51 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1291>

subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c

index f675330..d25f95a 100644 (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);