Chromium Code Reviews| Index: chrome/browser/chromeos/audio_mixer_alsa.cc |
| diff --git a/chrome/browser/chromeos/audio_mixer_alsa.cc b/chrome/browser/chromeos/audio_mixer_alsa.cc |
| index 34fb722ab0e51b9ad098568e9949764a95a530d4..07a6b964e968c8d952c2518a3f2b130ee0291ab9 100644 |
| --- a/chrome/browser/chromeos/audio_mixer_alsa.cc |
| +++ b/chrome/browser/chromeos/audio_mixer_alsa.cc |
| @@ -246,6 +246,8 @@ bool AudioMixerAlsa::InitializeAlsaMixer() { |
| snd_mixer_t* handle = NULL; |
| const char* card = "default"; |
| + PingPCM(); |
|
scherkus (not reviewing)
2011/03/02 19:07:11
maybe inline this code considering it's not caleld
davejcool
2011/03/03 20:05:02
It is remarkably close to the other calls in Initi
|
| + |
| if ((err = snd_mixer_open(&handle, 0)) < 0) { |
| LOG(ERROR) << "ALSA mixer " << card << " open error: " << snd_strerror(err); |
| return false; |
| @@ -519,4 +521,17 @@ void AudioMixerAlsa::SetElementMuted_Locked(snd_mixer_elem_t* elem, bool mute) { |
| } |
| } |
| +void AudioMixerAlsa::PingPCM() { |
| + snd_pcm_t* pcm_out_handle; |
| + int err; |
| + if ((err = snd_pcm_open(&pcm_out_handle, |
| + "default", |
| + SND_PCM_STREAM_PLAYBACK, |
| + 0)) >= 0) { |
| + snd_pcm_close(pcm_out_handle); |
| + return; |
| + } |
| + LOG(ERROR) << "ALSA PCM open error: " << snd_strerror(err); |
| +} |
| + |
| } // namespace chromeos |