Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(616)

Unified Diff: chrome/browser/chromeos/audio_mixer_alsa.cc

Issue 6591095: Mute ALSA audio completely (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/chromeos
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« chrome/browser/chromeos/audio_mixer_alsa.h ('K') | « chrome/browser/chromeos/audio_mixer_alsa.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698