| Index: media/audio/linux/audio_manager_linux.cc
|
| diff --git a/media/audio/linux/audio_manager_linux.cc b/media/audio/linux/audio_manager_linux.cc
|
| index 0b34aaa81186e0e6a491895c8364c5817cab0e39..8a8cad219c0f30813436ba13adda17b4473ff27b 100644
|
| --- a/media/audio/linux/audio_manager_linux.cc
|
| +++ b/media/audio/linux/audio_manager_linux.cc
|
| @@ -18,6 +18,7 @@
|
| #include "media/audio/pulse/pulse_output.h"
|
| #endif
|
| #if defined(USE_CRAS)
|
| +#include "media/audio/linux/cras_input.h"
|
| #include "media/audio/linux/cras_output.h"
|
| #endif
|
| #include "media/base/limits.h"
|
| @@ -267,36 +268,34 @@ AudioInputStream* AudioManagerLinux::MakeLowLatencyInputStream(
|
|
|
| AudioOutputStream* AudioManagerLinux::MakeOutputStream(
|
| const AudioParameters& params) {
|
| - AudioOutputStream* stream = NULL;
|
| #if defined(USE_CRAS)
|
| if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseCras)) {
|
| - stream = new CrasOutputStream(params, this);
|
| - } else {
|
| + return new CrasOutputStream(params, this);
|
| + }
|
| #endif
|
| +
|
| #if defined(USE_PULSEAUDIO)
|
| if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUsePulseAudio)) {
|
| - stream = new PulseAudioOutputStream(params, this);
|
| - } else {
|
| -#endif
|
| - std::string device_name = AlsaPcmOutputStream::kAutoSelectDevice;
|
| - if (CommandLine::ForCurrentProcess()->HasSwitch(
|
| - switches::kAlsaOutputDevice)) {
|
| - device_name = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
| - switches::kAlsaOutputDevice);
|
| - }
|
| - stream = new AlsaPcmOutputStream(device_name, params, wrapper_.get(), this);
|
| -#if defined(USE_PULSEAUDIO)
|
| + return new PulseAudioOutputStream(params, this);
|
| }
|
| #endif
|
| -#if defined(USE_CRAS)
|
| +
|
| + std::string device_name = AlsaPcmOutputStream::kAutoSelectDevice;
|
| + if (CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kAlsaOutputDevice)) {
|
| + device_name = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
| + switches::kAlsaOutputDevice);
|
| }
|
| -#endif
|
| - DCHECK(stream);
|
| - return stream;
|
| + return new AlsaPcmOutputStream(device_name, params, wrapper_.get(), this);
|
| }
|
|
|
| AudioInputStream* AudioManagerLinux::MakeInputStream(
|
| const AudioParameters& params, const std::string& device_id) {
|
| +#if defined(USE_CRAS)
|
| + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseCras)) {
|
| + return new CrasInputStream(params, this);
|
| + }
|
| +#endif
|
|
|
| std::string device_name = (device_id == AudioManagerBase::kDefaultDeviceId) ?
|
| AlsaPcmInputStream::kAutoSelectDevice : device_id;
|
|
|