webrtcbin: Store newly created transceivers when creating an answer also in the seen...
authorSebastian Dröge <sebastian@centricular.com>
Tue, 8 Jun 2021 08:40:14 +0000 (11:40 +0300)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 25 Jun 2021 09:45:24 +0000 (09:45 +0000)
Otherwise it might be used a second time for another media afterwards.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2310>

ext/webrtc/gstwebrtcbin.c

index 8870235..351bddd 100644 (file)
@@ -3710,8 +3710,6 @@ _create_answer_task (GstWebRTCBin * webrtc, const GstStructure * options,
         answer_dir = GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY;
       }
 
-      seen_transceivers = g_list_prepend (seen_transceivers, rtp_trans);
-
       if (!rtp_trans) {
         GstCaps *trans_caps;
 
@@ -3743,6 +3741,8 @@ _create_answer_task (GstWebRTCBin * webrtc, const GstStructure * options,
         trans = WEBRTC_TRANSCEIVER (rtp_trans);
       }
 
+      seen_transceivers = g_list_prepend (seen_transceivers, rtp_trans);
+
       if (gst_caps_is_empty (answer_caps)) {
         GST_WARNING_OBJECT (webrtc, "Could not create caps for media");
         gst_caps_unref (answer_caps);