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

Unified Diff: media/audio/mac/audio_low_latency_output_mac.cc

Issue 7533020: Move SwizzleCoreAudioLayout5_1() closer to where it's called. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: Created 9 years, 5 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 | « media/audio/audio_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_low_latency_output_mac.cc
diff --git a/media/audio/mac/audio_low_latency_output_mac.cc b/media/audio/mac/audio_low_latency_output_mac.cc
index e63477630c119a260b1449f4c7f26856c7b80897..eb8eb1c74d769eb98713fac561029995b2ac777b 100644
--- a/media/audio/mac/audio_low_latency_output_mac.cc
+++ b/media/audio/mac/audio_low_latency_output_mac.cc
@@ -11,7 +11,22 @@
#include "media/audio/audio_util.h"
#include "media/audio/mac/audio_manager_mac.h"
-using media::SwizzleCoreAudioLayout5_1;
+// Reorder PCM from AAC layout to Core Audio 5.1 layout.
+// TODO(fbarchard): Switch layout when ffmpeg is updated.
+template<class Format>
+static void SwizzleCoreAudioLayout5_1(Format* b, uint32 filled) {
+ static const int kNumSurroundChannels = 6;
+ Format aac[kNumSurroundChannels];
+ for (uint32 i = 0; i < filled; i += sizeof(aac), b += kNumSurroundChannels) {
+ memcpy(aac, b, sizeof(aac));
+ b[0] = aac[1]; // L
+ b[1] = aac[2]; // R
+ b[2] = aac[0]; // C
+ b[3] = aac[5]; // LFE
+ b[4] = aac[3]; // Ls
+ b[5] = aac[4]; // Rs
+ }
+}
// Overview of operation:
// 1) An object of AUAudioOutputStream is created by the AudioManager
« no previous file with comments | « media/audio/audio_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698