Chromium Code Reviews| Index: media/audio/linux/alsa_output.cc |
| diff --git a/media/audio/linux/alsa_output.cc b/media/audio/linux/alsa_output.cc |
| index b3f931d7ae7d2480815e5695dbfeda9149ee7612..c5b6da2ee08e1544bc12ab13b1740d908f3c1657 100644 |
| --- a/media/audio/linux/alsa_output.cc |
| +++ b/media/audio/linux/alsa_output.cc |
| @@ -50,9 +50,10 @@ |
| #include "media/base/seekable_buffer.h" |
| namespace { |
|
Ami GONE FROM CHROMIUM
2012/01/26 03:51:34
media/ code actually goes the other way - preferri
James Hawkins
2012/01/26 03:53:02
Why would we use two different styles in the same
James Hawkins
2012/01/26 04:13:02
Removed namespace and added back static per-prefer
|
| + |
| // Amount of time to wait if we've exhausted the data source. This is to avoid |
| // busy looping. |
| -static const uint32 kNoDataSleepMilliseconds = 10; |
| +const uint32 kNoDataSleepMilliseconds = 10; |
| // Mininum interval between OnMoreData() calls. |
| const uint32 kMinIntervalBetweenOnMoreDataCallsInMs = 5; |
| @@ -60,19 +61,19 @@ const uint32 kMinIntervalBetweenOnMoreDataCallsInMs = 5; |
| // According to the linux nanosleep manpage, nanosleep on linux can miss the |
| // deadline by up to 10ms because the kernel timeslice is 10ms. Give a 2x |
| // buffer to compensate for the timeslice, and any additional slowdowns. |
| -static const uint32 kSleepErrorMilliseconds = 20; |
| +const uint32 kSleepErrorMilliseconds = 20; |
| // Set to 0 during debugging if you want error messages due to underrun |
| // events or other recoverable errors. |
| #if defined(NDEBUG) |
| -static const int kPcmRecoverIsSilent = 1; |
| +const int kPcmRecoverIsSilent = 1; |
| #else |
| -static const int kPcmRecoverIsSilent = 0; |
| +const int kPcmRecoverIsSilent = 0; |
| #endif |
| // ALSA is currently limited to 48kHz. |
| // TODO(fbarchard): Resample audio from higher frequency to 48000. |
| -static const int kAlsaMaxSampleRate = 48000; |
| +const int kAlsaMaxSampleRate = 48000; |
| // While the "default" device may support multi-channel audio, in Alsa, only |
| // the device names surround40, surround41, surround50, etc, have a defined |
| @@ -91,7 +92,7 @@ static const int kAlsaMaxSampleRate = 48000; |
| // TODO(ajwong): The source data should have enough info to tell us if we want |
| // surround41 versus surround51, etc., instead of needing us to guess base don |
| // channel number. Fix API to pass that data down. |
| -static const char* GuessSpecificDeviceName(uint32 channels) { |
| +const char* GuessSpecificDeviceName(uint32 channels) { |
| switch (channels) { |
| case 8: |
| return "surround71"; |
| @@ -116,7 +117,7 @@ static const char* GuessSpecificDeviceName(uint32 channels) { |
| // Reorder PCM from AAC layout to Alsa layout. |
| // TODO(fbarchard): Switch layout when ffmpeg is updated. |
| template<class Format> |
| -static void Swizzle50Layout(Format* b, uint32 filled) { |
| +void Swizzle50Layout(Format* b, uint32 filled) { |
| static const uint32 kNumSurroundChannels = 5; |
| Format aac[kNumSurroundChannels]; |
| for (uint32 i = 0; i < filled; i += sizeof(aac), b += kNumSurroundChannels) { |
| @@ -130,7 +131,7 @@ static void Swizzle50Layout(Format* b, uint32 filled) { |
| } |
| template<class Format> |
| -static void Swizzle51Layout(Format* b, uint32 filled) { |
| +void Swizzle51Layout(Format* b, uint32 filled) { |
| static const uint32 kNumSurroundChannels = 6; |
| Format aac[kNumSurroundChannels]; |
| for (uint32 i = 0; i < filled; i += sizeof(aac), b += kNumSurroundChannels) { |
| @@ -143,7 +144,8 @@ static void Swizzle51Layout(Format* b, uint32 filled) { |
| b[5] = aac[5]; // LFE |
| } |
| } |
| -} // end namespace |
| + |
| +} // namespace |
| std::ostream& operator<<(std::ostream& os, |
| AlsaPcmOutputStream::InternalState state) { |