Fix data race for RTCPReceiver stats callback.

Annotates the callback which identifies the bug, then fixes it.

R=stefan@webrtc.org
BUG=

Review URL: https://webrtc-codereview.appspot.com/40009004

Cr-Commit-Position: refs/heads/master@{#8390}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8390 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org 2015-02-17 14:45:08 +00:00
parent 8f605e8911
commit a28a91d2f0
2 changed files with 2 additions and 1 deletions

View File

@ -770,6 +770,7 @@ void RTCPReceiver::HandleSDESChunk(RTCPUtility::RTCPParserV2& rtcpParser) {
cnameInfo->name[RTCP_CNAME_SIZE - 1] = 0;
strncpy(cnameInfo->name, rtcpPacket.CName.CName, RTCP_CNAME_SIZE - 1);
CriticalSectionScoped lock(_criticalSectionFeedbacks);
if (stats_callback_ != NULL) {
stats_callback_->CNameChanged(rtcpPacket.CName.CName,
rtcpPacket.CName.SenderSSRC);

View File

@ -274,7 +274,7 @@ protected:
// delivered RTP packet to the remote side.
int64_t _lastIncreasedSequenceNumberMs;
RtcpStatisticsCallback* stats_callback_;
RtcpStatisticsCallback* stats_callback_ GUARDED_BY(_criticalSectionFeedbacks);
RtcpPacketTypeCounter packet_type_counter_;