summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2018-12-18 13:32:02 +1100
committerMatthew Waters <matthew@centricular.com>2018-12-19 00:44:06 +0000
commit26a5cbddbb70b60a4a66bfd1eea6a87add0160a8 (patch)
treef5e7853a950568fe6d4eef4cf5f507e278161b98 /ext
parent0a3f662ed6f2090e68ec3415aada5d6eb85413c9 (diff)
downloadgstreamer-plugins-bad-26a5cbddbb70b60a4a66bfd1eea6a87add0160a8.tar.gz
webrtcbin: only change the receive state after setting the dtls-client
Doing so before will cause SSL errors with fast-start implementations like Chrome or if media data arrives before an answer.
Diffstat (limited to 'ext')
-rw-r--r--ext/webrtc/gstwebrtcbin.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/ext/webrtc/gstwebrtcbin.c b/ext/webrtc/gstwebrtcbin.c
index 0a967abe5..9f8ac670c 100644
--- a/ext/webrtc/gstwebrtcbin.c
+++ b/ext/webrtc/gstwebrtcbin.c
@@ -3107,6 +3107,8 @@ _update_transceiver_from_sdp_media (GstWebRTCBin * webrtc,
}
if (new_dir != prev_dir) {
+ ReceiveState receive_state = 0;
+
GST_TRACE_OBJECT (webrtc, "transceiver direction change");
if (new_dir == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY ||
@@ -3163,17 +3165,22 @@ _update_transceiver_from_sdp_media (GstWebRTCBin * webrtc,
_add_pad_to_list (webrtc, pad);
}
- transport_receive_bin_set_receive_state (stream->receive_bin,
- RECEIVE_STATE_PASS);
+ receive_state = RECEIVE_STATE_PASS;
} else if (!bundled) {
- transport_receive_bin_set_receive_state (stream->receive_bin,
- RECEIVE_STATE_DROP);
+ receive_state = RECEIVE_STATE_DROP;
}
if (!bundled || bundle_idx == media_idx)
g_object_set (stream, "dtls-client",
new_setup == GST_WEBRTC_DTLS_SETUP_ACTIVE, NULL);
+ /* Must be after setting the "dtls-client" so that data is not pushed into
+ * the dtlssrtp elements before the ssl direction has been set which will
+ * throw SSL errors */
+ if (receive_state > 0)
+ transport_receive_bin_set_receive_state (stream->receive_bin,
+ receive_state);
+
rtp_trans->mline = media_idx;
rtp_trans->current_direction = new_dir;
}