Fixes a coverity warning in the mixer module.
Review URL: https://webrtc-codereview.appspot.com/388009 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1688 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
132261446b
commit
b38a66aaac
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* Use of this source code is governed by a BSD-style license
|
||||||
* that can be found in the LICENSE file in the root of the source
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -803,27 +803,37 @@ void AudioConferenceMixerImpl::UpdateToMix(
|
|||||||
bool replaceWasMixed = false;
|
bool replaceWasMixed = false;
|
||||||
MapItem* replaceParticipant = mixParticipantList.Find(
|
MapItem* replaceParticipant = mixParticipantList.Find(
|
||||||
replaceFrame->_id);
|
replaceFrame->_id);
|
||||||
static_cast<MixerParticipant*>(
|
// When a frame is pushed to |activeList| it is also pushed
|
||||||
replaceParticipant->GetItem())->_mixHistory->WasMixed(
|
// to mixParticipantList with the frame's id. This means
|
||||||
replaceWasMixed);
|
// that the Find call above should never fail.
|
||||||
|
if(replaceParticipant == NULL)
|
||||||
mixParticipantList.Erase(replaceFrame->_id);
|
|
||||||
activeList.Erase(replaceItem);
|
|
||||||
|
|
||||||
activeList.PushFront(static_cast<void*>(audioFrame));
|
|
||||||
mixParticipantList.Insert(audioFrame->_id,
|
|
||||||
static_cast<void*>(participant));
|
|
||||||
assert(mixParticipantList.Size() <=
|
|
||||||
kMaximumAmountOfMixedParticipants);
|
|
||||||
|
|
||||||
if(replaceWasMixed)
|
|
||||||
{
|
{
|
||||||
RampOut(*replaceFrame);
|
assert(false);
|
||||||
rampOutList.PushBack(static_cast<void*>(replaceFrame));
|
|
||||||
assert(rampOutList.GetSize() <=
|
|
||||||
kMaximumAmountOfMixedParticipants);
|
|
||||||
} else {
|
} else {
|
||||||
_audioFramePool->PushMemory(replaceFrame);
|
static_cast<MixerParticipant*>(
|
||||||
|
replaceParticipant->GetItem())->_mixHistory->
|
||||||
|
WasMixed(replaceWasMixed);
|
||||||
|
|
||||||
|
mixParticipantList.Erase(replaceFrame->_id);
|
||||||
|
activeList.Erase(replaceItem);
|
||||||
|
|
||||||
|
activeList.PushFront(static_cast<void*>(audioFrame));
|
||||||
|
mixParticipantList.Insert(
|
||||||
|
audioFrame->_id,
|
||||||
|
static_cast<void*>(participant));
|
||||||
|
assert(mixParticipantList.Size() <=
|
||||||
|
kMaximumAmountOfMixedParticipants);
|
||||||
|
|
||||||
|
if(replaceWasMixed)
|
||||||
|
{
|
||||||
|
RampOut(*replaceFrame);
|
||||||
|
rampOutList.PushBack(
|
||||||
|
static_cast<void*>(replaceFrame));
|
||||||
|
assert(rampOutList.GetSize() <=
|
||||||
|
kMaximumAmountOfMixedParticipants);
|
||||||
|
} else {
|
||||||
|
_audioFramePool->PushMemory(replaceFrame);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(wasMixed)
|
if(wasMixed)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user