Commit 26a5cbdd authored by Matthew Waters's avatar Matthew Waters 🐨
Browse files

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.
parent 0a3f662e
...@@ -3107,6 +3107,8 @@ _update_transceiver_from_sdp_media (GstWebRTCBin * webrtc, ...@@ -3107,6 +3107,8 @@ _update_transceiver_from_sdp_media (GstWebRTCBin * webrtc,
} }
if (new_dir != prev_dir) { if (new_dir != prev_dir) {
ReceiveState receive_state = 0;
GST_TRACE_OBJECT (webrtc, "transceiver direction change"); GST_TRACE_OBJECT (webrtc, "transceiver direction change");
if (new_dir == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY || if (new_dir == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY ||
...@@ -3163,17 +3165,22 @@ _update_transceiver_from_sdp_media (GstWebRTCBin * webrtc, ...@@ -3163,17 +3165,22 @@ _update_transceiver_from_sdp_media (GstWebRTCBin * webrtc,
_add_pad_to_list (webrtc, pad); _add_pad_to_list (webrtc, pad);
} }
transport_receive_bin_set_receive_state (stream->receive_bin, receive_state = RECEIVE_STATE_PASS;
RECEIVE_STATE_PASS);
} else if (!bundled) { } else if (!bundled) {
transport_receive_bin_set_receive_state (stream->receive_bin, receive_state = RECEIVE_STATE_DROP;
RECEIVE_STATE_DROP);
} }
if (!bundled || bundle_idx == media_idx) if (!bundled || bundle_idx == media_idx)
g_object_set (stream, "dtls-client", g_object_set (stream, "dtls-client",
new_setup == GST_WEBRTC_DTLS_SETUP_ACTIVE, NULL); 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->mline = media_idx;
rtp_trans->current_direction = new_dir; rtp_trans->current_direction = new_dir;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment