Fix "unreachable code" warnings (MSVC warning 4702) in webrtc.

BUG=chromium:346399
TEST=none
R=tommi@webrtc.org

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

Patch from Peter Kasting <pkasting@chromium.org>.

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5747 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org 2014-03-21 10:26:42 +00:00
parent 0209e565de
commit 0e65fdaa3b
5 changed files with 30 additions and 40 deletions

View File

@ -1750,8 +1750,6 @@ int32_t AudioDeviceModuleImpl::StopRawOutputFileRecording()
CHECK_INITIALIZED();
return (_audioDeviceBuffer.StopOutputFileRecording());
return 0;
}
// ----------------------------------------------------------------------------

View File

@ -782,14 +782,17 @@ int VideoReceiver::SetReceiverRobustnessMode(
_keyRequestMode = kKeyOnError; // TODO(hlundin): On long NACK list?
break;
case VideoCodingModule::kSoftNack:
#if 1
assert(false); // TODO(hlundin): Not completed.
return VCM_NOT_IMPLEMENTED;
#else
// Enable hybrid NACK/FEC. Always wait for retransmissions and don't add
// extra delay when RTT is above kLowRttNackMs.
_receiver.SetNackMode(kNack, media_optimization::kLowRttNackMs, -1);
_dualReceiver.SetNackMode(kNoNack, -1, -1);
_keyRequestMode = kKeyOnError;
break;
#endif
case VideoCodingModule::kDualDecoder:
if (decode_error_mode == kNoErrors) {
return VCM_PARAMETER_ERROR;
@ -802,14 +805,17 @@ int VideoReceiver::SetReceiverRobustnessMode(
_keyRequestMode = kKeyOnError;
break;
case VideoCodingModule::kReferenceSelection:
#if 1
assert(false); // TODO(hlundin): Not completed.
return VCM_NOT_IMPLEMENTED;
#else
if (decode_error_mode == kNoErrors) {
return VCM_PARAMETER_ERROR;
}
_receiver.SetNackMode(kNoNack, -1, -1);
_dualReceiver.SetNackMode(kNoNack, -1, -1);
break;
#endif
}
_receiver.SetDecodeErrorMode(decode_error_mode);
// The dual decoder should never decode with errors.

View File

@ -488,7 +488,6 @@ int VoECodecImpl::SetISACMaxPayloadSize(int channel, int sizeBytes)
"SetISACMaxPayloadSize() iSAC codec is not supported");
return -1;
#endif
return 0;
}
int VoECodecImpl::SetVADStatus(int channel, bool enable, VadModes mode,

View File

@ -627,13 +627,12 @@ int VoEHardwareImpl::ResetAudioDevice()
" Failed to reset sound device");
return -1;
}
return 0;
#else
_shared->SetLastError(VE_FUNC_NOT_SUPPORTED, kTraceError,
" no support for resetting sound device");
return -1;
#endif
return 0;
}
int VoEHardwareImpl::AudioDeviceControl(unsigned int par1, unsigned int par2,

View File

@ -294,20 +294,16 @@ int VoEVolumeControlImpl::SetInputMute(int channel, bool enable)
// Mute before demultiplexing <=> affects all channels
return _shared->transmit_mixer()->SetMute(enable);
}
else
// Mute after demultiplexing <=> affects one channel only
voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
voe::Channel* channelPtr = ch.channel();
if (channelPtr == NULL)
{
// Mute after demultiplexing <=> affects one channel only
voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
voe::Channel* channelPtr = ch.channel();
if (channelPtr == NULL)
{
_shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
"SetInputMute() failed to locate channel");
return -1;
}
return channelPtr->SetMute(enable);
_shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
"SetInputMute() failed to locate channel");
return -1;
}
return 0;
return channelPtr->SetMute(enable);
}
int VoEVolumeControlImpl::GetInputMute(int channel, bool& enabled)
@ -574,20 +570,16 @@ int VoEVolumeControlImpl::SetOutputVolumePan(int channel,
// Master balance (affectes the signal after output mixing)
return _shared->output_mixer()->SetOutputVolumePan(left, right);
}
else
// Per-channel balance (affects the signal before output mixing)
voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
voe::Channel* channelPtr = ch.channel();
if (channelPtr == NULL)
{
// Per-channel balance (affects the signal before output mixing)
voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
voe::Channel* channelPtr = ch.channel();
if (channelPtr == NULL)
{
_shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
"SetOutputVolumePan() failed to locate channel");
return -1;
}
return channelPtr->SetOutputVolumePan(left, right);
_shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
"SetOutputVolumePan() failed to locate channel");
return -1;
}
return 0;
return channelPtr->SetOutputVolumePan(left, right);
}
int VoEVolumeControlImpl::GetOutputVolumePan(int channel,
@ -618,19 +610,15 @@ int VoEVolumeControlImpl::GetOutputVolumePan(int channel,
{
return _shared->output_mixer()->GetOutputVolumePan(left, right);
}
else
voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
voe::Channel* channelPtr = ch.channel();
if (channelPtr == NULL)
{
voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
voe::Channel* channelPtr = ch.channel();
if (channelPtr == NULL)
{
_shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
"GetOutputVolumePan() failed to locate channel");
return -1;
}
return channelPtr->GetOutputVolumePan(left, right);
_shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
"GetOutputVolumePan() failed to locate channel");
return -1;
}
return 0;
return channelPtr->GetOutputVolumePan(left, right);
}
#endif // #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API