From f5316137237dc120252852fc9ff97de34e8bdae6 Mon Sep 17 00:00:00 2001
From: patrick96
Date: Mon, 12 Feb 2018 11:29:55 +0100
Subject: [PATCH] fix(alsa): Use proper speaker mixer name and soundcard
The old code causes a segmentation fault, if the speaker and headphone
soundcards differ.
---
src/modules/alsa.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/alsa.cpp b/src/modules/alsa.cpp
index 3df04e32..8b802457 100644
--- a/src/modules/alsa.cpp
+++ b/src/modules/alsa.cpp
@@ -240,7 +240,7 @@ namespace modules {
}
if (m_mixer[mixer::SPEAKER] && !m_mixer[mixer::SPEAKER]->get_name().empty() && !headphones) {
mixers.emplace_back(new mixer_t::element_type(
- string{m_mixer[mixer::SPEAKER]->get_name()}, string{m_mixer[mixer::HEADPHONE]->get_sound_card()}));
+ string{m_mixer[mixer::SPEAKER]->get_name()}, string{m_mixer[mixer::SPEAKER]->get_sound_card()}));
}
if (cmd.compare(0, strlen(EVENT_TOGGLE_MUTE), EVENT_TOGGLE_MUTE) == 0) {