Protect reads of ViEEncoder::video_suspended_.
Does not fix an immediate bug, since this is the only method writing to it there are no concurrent writes, but this should be more future-proof by protecting all accesses. BUG=2606 R=stefan@webrtc.org Review URL: https://webrtc-codereview.appspot.com/4109006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5156 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -1112,19 +1112,19 @@ void ViEEncoder::OnNetworkChanged(const uint32_t bitrate_bps,
|
|||||||
max_padding_bitrate_kbps,
|
max_padding_bitrate_kbps,
|
||||||
pad_up_to_bitrate_kbps);
|
pad_up_to_bitrate_kbps);
|
||||||
default_rtp_rtcp_->SetTargetSendBitrate(stream_bitrates);
|
default_rtp_rtcp_->SetTargetSendBitrate(stream_bitrates);
|
||||||
if (video_is_suspended != video_suspended_) {
|
{
|
||||||
// State changed now. Send callback to inform about that.
|
CriticalSectionScoped cs(data_cs_.get());
|
||||||
{
|
if (video_suspended_ == video_is_suspended)
|
||||||
CriticalSectionScoped cs(data_cs_.get());
|
return;
|
||||||
video_suspended_ = video_is_suspended;
|
video_suspended_ = video_is_suspended;
|
||||||
}
|
}
|
||||||
if (codec_observer_) {
|
// State changed, inform codec observer.
|
||||||
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo,
|
if (codec_observer_) {
|
||||||
ViEId(engine_id_, channel_id_),
|
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo,
|
||||||
"%s: video_suspended_ changed to %i",
|
ViEId(engine_id_, channel_id_),
|
||||||
__FUNCTION__, video_suspended_);
|
"%s: video_suspended_ changed to %i",
|
||||||
codec_observer_->VideoSuspended(channel_id_, video_suspended_);
|
__FUNCTION__, video_is_suspended);
|
||||||
}
|
codec_observer_->VideoSuspended(channel_id_, video_is_suspended);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user