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

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

Issue 261028: Support 8 and 32 bit formats for Mac Channel Swizzler. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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: media/audio/mac/audio_output_mac.cc
===================================================================
--- media/audio/mac/audio_output_mac.cc (revision 28539)
+++ media/audio/mac/audio_output_mac.cc (working copy)
@@ -169,9 +169,10 @@
// Reorder PCM from AAC layout to Core Audio layout.
// TODO(fbarchard): Switch layout when ffmpeg is updated.
-const int kNumSurroundChannels = 6;
+namespace {
template<class Format>
static void SwizzleLayout(Format *b, size_t filled) {
+ static const int kNumSurroundChannels = 6;
Format aac[kNumSurroundChannels];
for (size_t i = 0; i < filled; i += sizeof(aac), b += kNumSurroundChannels) {
memcpy(aac, b, sizeof(aac));
@@ -183,6 +184,7 @@
b[5] = aac[4]; // Rs
}
}
+} // namespace
// Note to future hackers of this function: Do not add locks here because we
// call out to third party source that might do crazy things including adquire
@@ -218,7 +220,7 @@
return;
}
- // Handle channel order for PCM 5.1 audio.
+ // Handle channel order for 5.1 audio.
if (audio_stream->format_.mChannelsPerFrame == 6) {
if (audio_stream->format_.mBitsPerChannel == 8) {
SwizzleLayout(reinterpret_cast<uint8*>(buffer->mAudioData), filled);
« 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