Chromium Code Reviews| Index: webrtc/voice_engine/channel.cc |
| diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc |
| index 37dc3b685b9243d7c31bdf35cb7b2ee9ce79ccc0..a36b13e566a3d1915c971ed5f456cbfdff48633b 100644 |
| --- a/webrtc/voice_engine/channel.cc |
| +++ b/webrtc/voice_engine/channel.cc |
| @@ -560,6 +560,29 @@ int32_t Channel::GetAudioFrame(int32_t id, AudioFrame* audioFrame) |
| } |
| } |
| + // External media. |
| + // Pass the audio buffers to the external media callback, if set, before |
| + // applying scaling/panning, as that applies to the mix operation. |
|
the sun
2015/12/10 12:36:32
Does this break any of our tests? It might break 3
|
| + // External recipients of the audio (e.g. via AudioTrack), will do their own |
| + // mixing. |
| + if (_outputExternalMedia) |
| + { |
| + CriticalSectionScoped cs(&_callbackCritSect); |
| + const bool isStereo = (audioFrame->num_channels_ == 2); |
| + if (_outputExternalMediaCallbackPtr) |
| + { |
| + // TODO(tommi, hlundin): There's no timestamp information that |
| + // accompanies the audio data. Fix pwetty pwease. |
| + _outputExternalMediaCallbackPtr->Process( |
| + _channelId, |
| + kPlaybackPerChannel, |
| + reinterpret_cast<int16_t*>(audioFrame->data_), |
| + audioFrame->samples_per_channel_, |
| + audioFrame->sample_rate_hz_, |
| + isStereo); |
| + } |
| + } |
| + |
| float output_gain = 1.0f; |
| float left_pan = 1.0f; |
| float right_pan = 1.0f; |
| @@ -601,23 +624,6 @@ int32_t Channel::GetAudioFrame(int32_t id, AudioFrame* audioFrame) |
| MixAudioWithFile(*audioFrame, audioFrame->sample_rate_hz_); |
| } |
| - // External media |
| - if (_outputExternalMedia) |
| - { |
| - CriticalSectionScoped cs(&_callbackCritSect); |
| - const bool isStereo = (audioFrame->num_channels_ == 2); |
| - if (_outputExternalMediaCallbackPtr) |
| - { |
| - _outputExternalMediaCallbackPtr->Process( |
| - _channelId, |
| - kPlaybackPerChannel, |
| - (int16_t*)audioFrame->data_, |
| - audioFrame->samples_per_channel_, |
| - audioFrame->sample_rate_hz_, |
| - isStereo); |
| - } |
| - } |
| - |
| // Record playout if enabled |
| { |
| CriticalSectionScoped cs(&_fileCritSect); |