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

Unified Diff: chromeos/audio/cras_audio_handler.cc

Issue 2802343002: Fix static initializers in CrasAudioHandler. (Closed)
Patch Set: Just the fix Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/audio/cras_audio_handler.cc
diff --git a/chromeos/audio/cras_audio_handler.cc b/chromeos/audio/cras_audio_handler.cc
index e4e35c44841d59d02148d2662d33dfffaf8fe9c1..37d80e618402510b08acb24e7cbe72eea648b398 100644
--- a/chromeos/audio/cras_audio_handler.cc
+++ b/chromeos/audio/cras_audio_handler.cc
@@ -37,9 +37,9 @@ const int kMuteThresholdPercent = 1;
const int kHDMIRediscoverGracePeriodDurationInMs = 2000;
// Mixer matrix, [0.5, 0.5; 0.5, 0.5]
-const std::vector<double> kStereoToMono = {0.5, 0.5, 0.5, 0.5};
+const double kStereoToMono[] = {0.5, 0.5, 0.5, 0.5};
// Mixer matrix, [1, 0; 0, 1]
-const std::vector<double> kStereoToStereo = {1, 0, 0, 1};
+const double kStereoToStereo[] = {1, 0, 0, 1};
static CrasAudioHandler* g_cras_audio_handler = nullptr;
@@ -430,11 +430,17 @@ void CrasAudioHandler::SwapInternalSpeakerLeftRightChannel(bool swap) {
void CrasAudioHandler::SetOutputMono(bool mono_on) {
output_mono_on_ = mono_on;
if (mono_on) {
- chromeos::DBusThreadManager::Get()->GetCrasAudioClient()->
- SetGlobalOutputChannelRemix(output_channels_, kStereoToMono);
+ chromeos::DBusThreadManager::Get()
+ ->GetCrasAudioClient()
Lei Zhang 2017/04/18 21:35:51 BTW, this is clang-format rewriting code however i
jennyz 2017/04/18 21:46:13 Acknowledged.
+ ->SetGlobalOutputChannelRemix(
+ output_channels_,
+ std::vector<double>(kStereoToMono, std::end(kStereoToMono)));
} else {
- chromeos::DBusThreadManager::Get()->GetCrasAudioClient()->
- SetGlobalOutputChannelRemix(output_channels_, kStereoToStereo);
+ chromeos::DBusThreadManager::Get()
+ ->GetCrasAudioClient()
+ ->SetGlobalOutputChannelRemix(
+ output_channels_,
+ std::vector<double>(kStereoToStereo, std::end(kStereoToStereo)));
}
for (auto& observer : observers_)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698