Fixing Coverity issues.
BUG=C14457, C10611 Review URL: https://webrtc-codereview.appspot.com/1320012 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3880 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
8aa4a90bd9
commit
aeff4f3003
@ -77,17 +77,14 @@ EncoderStateFeedback* ChannelGroup::GetEncoderStateFeedback() {
|
||||
return encoder_state_feedback_.get();
|
||||
}
|
||||
|
||||
bool ChannelGroup::SetChannelRembStatus(int channel_id,
|
||||
bool sender,
|
||||
bool receiver,
|
||||
ViEChannel* channel,
|
||||
ViEEncoder* encoder) {
|
||||
bool ChannelGroup::SetChannelRembStatus(int channel_id, bool sender,
|
||||
bool receiver, ViEChannel* channel) {
|
||||
// Update the channel state.
|
||||
if (sender || receiver) {
|
||||
if (!channel->EnableRemb(true)) {
|
||||
return false;
|
||||
}
|
||||
} else if (channel) {
|
||||
} else {
|
||||
channel->EnableRemb(false);
|
||||
}
|
||||
// Update the REMB instance with necessary RTP modules.
|
||||
|
@ -41,11 +41,8 @@ class ChannelGroup {
|
||||
bool HasChannel(int channel_id);
|
||||
bool Empty();
|
||||
|
||||
bool SetChannelRembStatus(int channel_id,
|
||||
bool sender,
|
||||
bool receiver,
|
||||
ViEChannel* channel,
|
||||
ViEEncoder* encoder);
|
||||
bool SetChannelRembStatus(int channel_id, bool sender, bool receiver,
|
||||
ViEChannel* channel);
|
||||
|
||||
BitrateController* GetBitrateController();
|
||||
CallStats* GetCallStats();
|
||||
@ -62,7 +59,7 @@ class ChannelGroup {
|
||||
scoped_ptr<EncoderStateFeedback> encoder_state_feedback_;
|
||||
ChannelSet channels_;
|
||||
|
||||
// Regisered at construct time and assumed to outlive this class.
|
||||
// Registered at construct time and assumed to outlive this class.
|
||||
ProcessThread* process_thread_;
|
||||
};
|
||||
|
||||
|
@ -241,8 +241,7 @@ int ViEChannelManager::DeleteChannel(int channel_id) {
|
||||
group = FindGroup(channel_id);
|
||||
group->GetCallStats()->DeregisterStatsObserver(
|
||||
vie_channel->GetStatsObserver());
|
||||
group->SetChannelRembStatus(channel_id, false, false, vie_channel,
|
||||
vie_encoder);
|
||||
group->SetChannelRembStatus(channel_id, false, false, vie_channel);
|
||||
|
||||
// Remove the feedback if we're owning the encoder.
|
||||
if (vie_encoder->channel_id() == channel_id) {
|
||||
@ -367,8 +366,7 @@ bool ViEChannelManager::SetRembStatus(int channel_id, bool sender,
|
||||
ViEEncoder* encoder = ViEEncoderPtr(channel_id);
|
||||
assert(encoder);
|
||||
|
||||
return group->SetChannelRembStatus(channel_id, sender, receiver, channel,
|
||||
encoder);
|
||||
return group->SetChannelRembStatus(channel_id, sender, receiver, channel);
|
||||
}
|
||||
|
||||
bool ViEChannelManager::SetBandwidthEstimationMode(
|
||||
|
@ -86,12 +86,12 @@ int ViECodecImpl::GetCodec(const unsigned char list_number,
|
||||
list_number, video_codec.codecType);
|
||||
if (list_number == VideoCodingModule::NumberOfCodecs()) {
|
||||
memset(&video_codec, 0, sizeof(VideoCodec));
|
||||
strncpy(video_codec.plName, "red", 3);
|
||||
strcpy(video_codec.plName, "red");
|
||||
video_codec.codecType = kVideoCodecRED;
|
||||
video_codec.plType = VCM_RED_PAYLOAD_TYPE;
|
||||
} else if (list_number == VideoCodingModule::NumberOfCodecs() + 1) {
|
||||
memset(&video_codec, 0, sizeof(VideoCodec));
|
||||
strncpy(video_codec.plName, "ulpfec", 6);
|
||||
strcpy(video_codec.plName, "ulpfec");
|
||||
video_codec.codecType = kVideoCodecULPFEC;
|
||||
video_codec.plType = VCM_ULPFEC_PAYLOAD_TYPE;
|
||||
} else if (VideoCodingModule::Codec(list_number, &video_codec) != VCM_OK) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user