Removed unnecessary Pulse init from VoE startup.

Saves 10% (~260ms) of the total PeerConnectionTest wallclock time.

R=niklas.enbom@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5254 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
fischman@webrtc.org 2013-12-10 21:01:34 +00:00
parent 762fcdcca9
commit 7ae8495779
3 changed files with 5 additions and 34 deletions

View File

@ -299,14 +299,16 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects()
#if defined(LINUX_PULSE)
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "attempting to use the Linux PulseAudio APIs...");
if (AudioDeviceLinuxPulse::PulseAudioIsSupported())
// create *Linux PulseAudio* implementation
AudioDeviceLinuxPulse* pulseDevice = new AudioDeviceLinuxPulse(Id());
if (pulseDevice->Init() != -1)
{
// create *Linux PulseAudio* implementation
ptrAudioDevice = new AudioDeviceLinuxPulse(Id());
ptrAudioDevice = pulseDevice;
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "Linux PulseAudio APIs will be utilized");
}
else
{
delete pulseDevice;
#endif
#if defined(LINUX_ALSA)
// create *Linux ALSA Audio* implementation

View File

@ -33,35 +33,6 @@ namespace webrtc
// Static Methods
// ============================================================================
bool AudioDeviceLinuxPulse::PulseAudioIsSupported()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, -1, "%s",
__FUNCTION__);
bool pulseAudioIsSupported(true);
// Check that we can initialize
AudioDeviceLinuxPulse* admPulse = new AudioDeviceLinuxPulse(-1);
if (admPulse->InitPulseAudio() == -1)
{
pulseAudioIsSupported = false;
}
admPulse->TerminatePulseAudio();
delete admPulse;
if (pulseAudioIsSupported)
{
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, -1,
"*** Linux Pulse Audio is supported ***");
} else
{
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, -1,
"*** Linux Pulse Audio is NOT supported => will revert to the ALSA API ***");
}
return (pulseAudioIsSupported);
}
AudioDeviceLinuxPulse::AudioDeviceLinuxPulse(const int32_t id) :
_ptrAudioBuffer(NULL),
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),

View File

@ -95,8 +95,6 @@ public:
AudioDeviceLinuxPulse(const int32_t id);
virtual ~AudioDeviceLinuxPulse();
static bool PulseAudioIsSupported();
// Retrieve the currently utilized audio layer
virtual int32_t ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const OVERRIDE;