Index: talk/app/webrtc/webrtcsession.cc |
diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc |
index c6d1856f0353957224932aeb8e0c076e4ccdfaa9..0270c554fbb1861bc7b7026d92d9e2a67d020fde 100644 |
--- a/talk/app/webrtc/webrtcsession.cc |
+++ b/talk/app/webrtc/webrtcsession.cc |
@@ -1844,6 +1844,8 @@ bool WebRtcSession::CreateVoiceChannel(const cricket::ContentInfo* content) { |
voice_channel_->SignalDtlsSetupFailure.connect( |
this, &WebRtcSession::OnDtlsSetupFailure); |
+ voice_channel_->SignalFirstPacketReceived.connect( |
+ this, &WebRtcSession::OnChannelFirstPacketReceived); |
SignalVoiceChannelCreated(); |
voice_channel_->transport_channel()->SignalSentPacket.connect( |
@@ -1861,6 +1863,8 @@ bool WebRtcSession::CreateVideoChannel(const cricket::ContentInfo* content) { |
video_channel_->SignalDtlsSetupFailure.connect( |
this, &WebRtcSession::OnDtlsSetupFailure); |
+ video_channel_->SignalFirstPacketReceived.connect( |
+ this, &WebRtcSession::OnChannelFirstPacketReceived); |
SignalVideoChannelCreated(); |
video_channel_->transport_channel()->SignalSentPacket.connect( |
@@ -1895,6 +1899,14 @@ void WebRtcSession::OnDtlsSetupFailure(cricket::BaseChannel*, bool rtcp) { |
rtcp ? kDtlsSetupFailureRtcp : kDtlsSetupFailureRtp); |
} |
+void WebRtcSession::OnChannelFirstPacketReceived(cricket::BaseChannel*) { |
+ ASSERT(signaling_thread()->IsCurrent()); |
+ if (!has_received_media_packet_) { |
+ has_received_media_packet_ = true; |
+ SignalFirstMediaPacketReceived(); |
+ } |
+} |
+ |
void WebRtcSession::OnDataChannelMessageReceived( |
cricket::DataChannel* channel, |
const cricket::ReceiveDataParams& params, |