Fixes an issue where file playing could happen at a lower sampling frequency than the file.
Details:
The mixer looks at all the participants desired frequency and concludes the highest desired mixing frequency. This is the frequency that the mixer will mix at. Participants that are always mixed are in a separate list and the function concluding the highest desired mixing frequency did not look at that list and therefore always conclude that the lowest mixing frequency is sufficient.
Review URL: http://webrtc-codereview.appspot.com/277003
git-svn-id: http://webrtc.googlecode.com/svn/trunk@915 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc b/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc
index ba4c829..e7ec069 100644
--- a/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc
+++ b/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc
@@ -626,8 +626,29 @@
// found is the lowest that can be used without losing information.
WebRtc_Word32 AudioConferenceMixerImpl::GetLowestMixingFrequency()
{
+ const int participantListFrequency =
+ GetLowestMixingFrequencyFromList(_participantList);
+ const int anonymousListFrequency =
+ GetLowestMixingFrequencyFromList(_additionalParticipantList);
+ const int highestFreq =
+ (participantListFrequency > anonymousListFrequency) ?
+ participantListFrequency : anonymousListFrequency;
+ // Check if the user specified a lowest mixing frequency.
+ if(_minimumMixingFreq != kLowestPossible)
+ {
+ if(_minimumMixingFreq > highestFreq)
+ {
+ return _minimumMixingFreq;
+ }
+ }
+ return highestFreq;
+}
+
+WebRtc_Word32 AudioConferenceMixerImpl::GetLowestMixingFrequencyFromList(
+ ListWrapper& mixList)
+{
WebRtc_Word32 highestFreq = 8000;
- ListItem* item = _participantList.First();
+ ListItem* item = mixList.First();
while(item)
{
MixerParticipant* participant =
@@ -637,16 +658,7 @@
{
highestFreq = neededFrequency;
}
- item = _participantList.Next(item);
- }
-
- // Check if the user specified a lowest mixing frequency.
- if(_minimumMixingFreq != kLowestPossible)
- {
- if(_minimumMixingFreq > highestFreq)
- {
- return _minimumMixingFreq;
- }
+ item = mixList.Next(item);
}
return highestFreq;
}
diff --git a/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.h b/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.h
index 6c961b9..f20e8ab 100644
--- a/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.h
+++ b/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.h
@@ -104,6 +104,7 @@
// Return the lowest mixing frequency that can be used without having to
// downsample any audio.
WebRtc_Word32 GetLowestMixingFrequency();
+ WebRtc_Word32 GetLowestMixingFrequencyFromList(ListWrapper& mixList);
// Return the AudioFrames that should be mixed anonymously.
void GetAdditionalAudio(ListWrapper& additionalFramesList);