Chromium Code Reviews| 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 d9127f8d2824b1c7040d10d71c8c83d10b49fb49..9db0f48d9cbea65c686c61e94b9fda59d08b3165 100644 |
| --- a/media/audio/mac/audio_low_latency_output_mac.cc |
| +++ b/media/audio/mac/audio_low_latency_output_mac.cc |
| @@ -53,7 +53,8 @@ AUAudioOutputStream::AUAudioOutputStream( |
| output_device_id_(kAudioObjectUnknown), |
| volume_(1), |
| hardware_latency_frames_(0), |
| - stopped_(false) { |
| + stopped_(false), |
| + audio_bus_(AudioBus::Create(params)) { |
| // We must have a manager. |
| DCHECK(manager_); |
| // A frame is one sample across all channels. In interleaved audio the per |
| @@ -226,11 +227,17 @@ OSStatus AUAudioOutputStream::Render(UInt32 number_of_frames, |
| uint8* audio_data = reinterpret_cast<uint8*>(buffer.mData); |
| uint32 hardware_pending_bytes = static_cast<uint32> |
| ((playout_latency_frames + 0.5) * format_.mBytesPerFrame); |
| - uint32 filled = source_->OnMoreData( |
| - audio_data, buffer.mDataByteSize, |
| - AudioBuffersState(0, hardware_pending_bytes)); |
| + |
| + DCHECK_EQ(number_of_frames, static_cast<UInt32>(audio_bus_->frames())); |
| + int frames_filled = source_->OnMoreData( |
| + audio_bus_.get(), AudioBuffersState(0, hardware_pending_bytes)); |
| + audio_bus_->ToInterleaved( |
| + frames_filled, format_.mBitsPerChannel / 8, audio_data); |
| + uint32 filled = frames_filled * format_.mBytesPerFrame; |
| // Handle channel order for 5.1 audio. |
| + // TODO(dalecurtis): Channel downmixing, upmixing, should be done in mixer; |
| + // volume adjust should use SSE optimized vector_fmul() prior to interleave. |
|
Chris Rogers
2012/08/24 20:20:26
I think we're still going to need some platform-sp
DaleCurtis
2012/08/24 23:53:12
I'm hoping we can have each AOS return the matrix
|
| if (format_.mChannelsPerFrame == 6) { |
| if (format_.mBitsPerChannel == 8) { |
| SwizzleCoreAudioLayout5_1(reinterpret_cast<uint8*>(audio_data), filled); |