Fix compile warnings in Release configuration.

Review URL: http://webrtc-codereview.appspot.com/119003

git-svn-id: http://webrtc.googlecode.com/svn/trunk@424 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
andrew@webrtc.org 2011-08-23 17:53:54 +00:00
parent 06ad81fd58
commit ceb148ce59
5 changed files with 28 additions and 30 deletions

View File

@ -322,35 +322,34 @@ AudioCodingModuleImpl::TimeUntilNextProcess()
} }
// Process any pending tasks such as timeouts // Process any pending tasks such as timeouts
WebRtc_Word32 WebRtc_Word32
AudioCodingModuleImpl::Process() AudioCodingModuleImpl::Process()
{ {
WebRtc_UWord8 bitStream[2 * MAX_PAYLOAD_SIZE_BYTE]; // Make room for 1 RED payload WebRtc_UWord8 bitStream[2 * MAX_PAYLOAD_SIZE_BYTE]; // Make room for 1 RED payload
WebRtc_Word16 lengthBytes = 2 * MAX_PAYLOAD_SIZE_BYTE; WebRtc_Word16 lengthBytes = 2 * MAX_PAYLOAD_SIZE_BYTE;
WebRtc_Word16 redLengthBytes = lengthBytes;
WebRtc_UWord32 rtpTimestamp; WebRtc_UWord32 rtpTimestamp;
WebRtc_Word16 status; WebRtc_Word16 status;
WebRtcACMEncodingType encodingType; WebRtcACMEncodingType encodingType;
FrameType frameType = kAudioFrameSpeech; FrameType frameType = kAudioFrameSpeech;
WebRtc_Word16 redLengthBytes;
WebRtc_UWord8 currentPayloadType; WebRtc_UWord8 currentPayloadType;
bool hasDataToSend = false; bool hasDataToSend = false;
bool fecActive = false; bool fecActive = false;
WebRtc_UWord32 dummyFragLength;
// keep the scope of the ACM critical section limited // keep the scope of the ACM critical section limited
{ {
CriticalSectionScoped lock(*_acmCritSect); CriticalSectionScoped lock(*_acmCritSect);
if(!HaveValidEncoder("Process")) if(!HaveValidEncoder("Process"))
{ {
return -1; return -1;
} }
status = _codecs[_currentSendCodecIdx]->Encode(bitStream, &lengthBytes, status = _codecs[_currentSendCodecIdx]->Encode(bitStream, &lengthBytes,
&rtpTimestamp, &encodingType); &rtpTimestamp, &encodingType);
if (status < 0) // Encode failed if (status < 0) // Encode failed
{ {
// logging error // logging error
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, _id, WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, _id,
"Process(): Encoding Failed"); "Process(): Encoding Failed");
lengthBytes = 0; lengthBytes = 0;
return -1; return -1;
@ -415,7 +414,6 @@ AudioCodingModuleImpl::Process()
// one RTP packet and the fragmentation points // one RTP packet and the fragmentation points
// are set. // are set.
// Only apply RED on speech data. // Only apply RED on speech data.
if((_fecEnabled) && if((_fecEnabled) &&
((encodingType == kActiveNormalEncoded) || ((encodingType == kActiveNormalEncoded) ||
(encodingType == kPassiveNormalEncoded))) (encodingType == kPassiveNormalEncoded)))
@ -481,12 +479,12 @@ AudioCodingModuleImpl::Process()
// Insert new packet length. // Insert new packet length.
_fragmentation->fragmentationLength[0] = lengthBytes; _fragmentation->fragmentationLength[0] = lengthBytes;
// Insert new packet payload type. // Insert new packet payload type.
_fragmentation->fragmentationPlType[0] = currentPayloadType; _fragmentation->fragmentationPlType[0] = currentPayloadType;
_lastFECTimestamp = rtpTimestamp; _lastFECTimestamp = rtpTimestamp;
// can be modified by the getRedPayload() call if iSAC is utilized // can be modified by the GetRedPayload() call if iSAC is utilized
redLengthBytes = lengthBytes; redLengthBytes = lengthBytes;
// A fragmentation header is provided => packetization according to RFC 2198 // A fragmentation header is provided => packetization according to RFC 2198
// (RTP Payload for Redundant Audio Data) will be used. // (RTP Payload for Redundant Audio Data) will be used.
@ -505,11 +503,8 @@ AudioCodingModuleImpl::Process()
{ {
// The codec was not iSAC => use current encoder output as redundant data // The codec was not iSAC => use current encoder output as redundant data
// instead (trivial FEC scheme) // instead (trivial FEC scheme)
memcpy(_redBuffer, bitStream, redLengthBytes); memcpy(_redBuffer, bitStream, redLengthBytes);
} }
// Temporary storing RED length
dummyFragLength = redLengthBytes;
_isFirstRED = false; _isFirstRED = false;
// Update payload type with RED payload type // Update payload type with RED payload type
@ -533,10 +528,10 @@ AudioCodingModuleImpl::Process()
if(_packetizationCallback != NULL) if(_packetizationCallback != NULL)
{ {
if (fecActive) { if (fecActive) {
_packetizationCallback->SendData(frameType, currentPayloadType, _packetizationCallback->SendData(frameType, currentPayloadType,
rtpTimestamp, bitStream, lengthBytes, _fragmentation); rtpTimestamp, bitStream, lengthBytes, _fragmentation);
} else { } else {
_packetizationCallback->SendData(frameType, currentPayloadType, _packetizationCallback->SendData(frameType, currentPayloadType,
rtpTimestamp, bitStream, lengthBytes, NULL); rtpTimestamp, bitStream, lengthBytes, NULL);
} }
} }
@ -548,7 +543,7 @@ AudioCodingModuleImpl::Process()
} }
} }
if (fecActive) { if (fecActive) {
_fragmentation->fragmentationLength[1] = dummyFragLength; _fragmentation->fragmentationLength[1] = redLengthBytes;
} }
return lengthBytes; return lengthBytes;
} }

View File

@ -133,7 +133,7 @@ int ViEFileRecorder::StartRecording(const char* fileNameUTF8,
int ViEFileRecorder::StopRecording() int ViEFileRecorder::StopRecording()
{ {
int error; int error = 0;
// Stop recording audio // Stop recording audio
// Note - we can not hold the _ptrCritSect while accessing VE functions. It might cause deadlock in Write // Note - we can not hold the _ptrCritSect while accessing VE functions. It might cause deadlock in Write
if (_veFileInterface) if (_veFileInterface)

View File

@ -304,8 +304,7 @@ int ViESender::SendPacket(int vieId, const void *data, int len)
return -1; return -1;
} }
int channelId = ChannelId(vieId); assert(ChannelId(vieId) == _channelId);
assert(channelId == _channelId);
// Prepare for possible encryption and sending // Prepare for possible encryption and sending
WebRtc_UWord8* sendPacket = (WebRtc_UWord8*) data; WebRtc_UWord8* sendPacket = (WebRtc_UWord8*) data;
@ -356,8 +355,8 @@ int ViESender::SendRTCPPacket(int vieId, const void *data, int len)
// No transport // No transport
return -1; return -1;
} }
int channelId = ChannelId(vieId);
assert(channelId == _channelId); assert(ChannelId(vieId) == _channelId);
// Prepare for possible encryption and sending // Prepare for possible encryption and sending
WebRtc_UWord8* sendPacket = (WebRtc_UWord8*) data; WebRtc_UWord8* sendPacket = (WebRtc_UWord8*) data;

View File

@ -90,7 +90,13 @@ bool ViEAutoTestMain::BeginOSIndependentTesting()
} }
else else
{ {
scanf("%d", &testType); if (scanf("%d", &testType) <= 0)
{
ViETest::Log("ERROR: unable to read selection. Try again\n");
testType = -1;
getchar();
continue;
}
getchar(); getchar();
} }
ViETest::Log(""); ViETest::Log("");

View File

@ -639,8 +639,7 @@ Channel::OnInitializeDecoder(
"payloadName=%s, frequency=%u, channels=%u, rate=%u)", "payloadName=%s, frequency=%u, channels=%u, rate=%u)",
id, payloadType, payloadName, frequency, channels, rate); id, payloadType, payloadName, frequency, channels, rate);
WebRtc_Word32 channel = VoEChannelId(id); assert(VoEChannelId(id) == _channelId);
assert(channel == _channelId);
CodecInst receiveCodec; CodecInst receiveCodec;
CodecInst dummyCodec; CodecInst dummyCodec;
@ -658,7 +657,7 @@ Channel::OnInitializeDecoder(
if (_audioCodingModule.RegisterReceiveCodec(receiveCodec) == -1) if (_audioCodingModule.RegisterReceiveCodec(receiveCodec) == -1)
{ {
WEBRTC_TRACE(kTraceWarning, kTraceVoice, WEBRTC_TRACE(kTraceWarning, kTraceVoice,
VoEId(_instanceId,_channelId), VoEId(_instanceId, _channelId),
"Channel::OnInitializeDecoder() invalid codec (" "Channel::OnInitializeDecoder() invalid codec ("
"pt=%d, name=%s) received - 1", payloadType, payloadName); "pt=%d, name=%s) received - 1", payloadType, payloadName);
_engineStatisticsPtr->SetLastError(VE_AUDIO_CODING_MODULE_ERROR); _engineStatisticsPtr->SetLastError(VE_AUDIO_CODING_MODULE_ERROR);
@ -703,8 +702,7 @@ Channel::OnReceivedPacket(const WebRtc_Word32 id,
"Channel::OnReceivedPacket(id=%d, packetType=%d)", "Channel::OnReceivedPacket(id=%d, packetType=%d)",
id, packetType); id, packetType);
WebRtc_Word32 channel = VoEChannelId(id); assert(VoEChannelId(id) == _channelId);
assert(channel == _channelId);
// Notify only for the case when we have restarted an RTP session. // Notify only for the case when we have restarted an RTP session.
if (_rtpPacketTimedOut && (kPacketRtp == packetType)) if (_rtpPacketTimedOut && (kPacketRtp == packetType))