X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2Fwebrtc%2Fmodules%2Frtp_rtcp%2Fsource%2Frtp_sender.cc;h=0711356e7a6ac2a3edf1e56e3c43052c460bf831;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=fd320324b8a6cb84fa79e3aca01e6bd35c8a26b8;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/webrtc/modules/rtp_rtcp/source/rtp_sender.cc b/src/third_party/webrtc/modules/rtp_rtcp/source/rtp_sender.cc index fd32032..0711356 100644 --- a/src/third_party/webrtc/modules/rtp_rtcp/source/rtp_sender.cc +++ b/src/third_party/webrtc/modules/rtp_rtcp/source/rtp_sender.cc @@ -301,9 +301,9 @@ uint16_t RTPSender::MaxDataPayloadLength() const { if (audio_configured_) { return max_payload_length_ - RTPHeaderLength(); } else { - return max_payload_length_ - RTPHeaderLength() - - video_->FECPacketOverhead() - ((rtx_) ? 2 : 0); - // Include the FEC/ULP/RED overhead. + return max_payload_length_ - RTPHeaderLength() // RTP overhead. + - video_->FECPacketOverhead() // FEC/ULP/RED overhead. + - ((rtx_) ? 2 : 0); // RTX overhead. } } @@ -842,15 +842,16 @@ void RTPSender::UpdateRtpStats(const uint8_t* buffer, const RTPHeader& header, bool is_rtx, bool is_retransmit) { - CriticalSectionScoped lock(statistics_crit_.get()); StreamDataCounters* counters; - uint32_t ssrc; + // Get ssrc before taking statistics_crit_ to avoid possible deadlock. + uint32_t ssrc = SSRC(); + + CriticalSectionScoped lock(statistics_crit_.get()); if (is_rtx) { counters = &rtx_rtp_stats_; ssrc = ssrc_rtx_; } else { counters = &rtp_stats_; - ssrc = ssrc_; } bitrate_sent_.Update(size);