Index: media/filters/audio_renderer_algorithm.cc |
diff --git a/media/filters/audio_renderer_algorithm.cc b/media/filters/audio_renderer_algorithm.cc |
index ebe334a0f1a0c76c1063ed1c79512cc36fd4c6bb..18f3bbdf9fdd89c78bf5855ac0367ecabd7eb7bb 100644 |
--- a/media/filters/audio_renderer_algorithm.cc |
+++ b/media/filters/audio_renderer_algorithm.cc |
@@ -67,6 +67,7 @@ static const int kStartingCapacityInMs = 200; |
AudioRendererAlgorithm::AudioRendererAlgorithm() |
: channels_(0), |
samples_per_second_(0), |
+ is_raw_format_(false), |
muted_partial_frame_(0), |
capacity_(0), |
output_time_(0.0), |
@@ -87,6 +88,7 @@ void AudioRendererAlgorithm::Initialize(const AudioParameters& params) { |
channels_ = params.channels(); |
samples_per_second_ = params.sample_rate(); |
+ is_raw_format_ = params.IsRawFormat(); |
initial_capacity_ = capacity_ = |
std::max(params.frames_per_buffer() * 2, |
ConvertMillisecondsToFrames(kStartingCapacityInMs)); |
@@ -149,6 +151,14 @@ int AudioRendererAlgorithm::FillBuffer(AudioBus* dest, |
DCHECK_GT(playback_rate, 0); |
DCHECK_EQ(channels_, dest->channels()); |
+ dest->set_is_raw_format(is_raw_format_); |
+ if (is_raw_format_) { |
+ dest->set_data_size(0); |
+ dest->set_frames(0); |
+ |
+ return audio_buffer_.ReadFrames(requested_frames, dest_offset, dest); |
+ } |
+ |
// Optimize the muted case to issue a single clear instead of performing |
// the full crossfade and clearing each crossfaded frame. |
if (playback_rate < kMinPlaybackRate || playback_rate > kMaxPlaybackRate) { |