| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/base/multi_channel_resampler.h" | 5 #include "media/base/multi_channel_resampler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "media/base/audio_bus.h" | 10 #include "media/base/audio_bus.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // All channels must ask for the same amount. This should always be the | 87 // All channels must ask for the same amount. This should always be the |
| 88 // case, but let's just make sure. | 88 // case, but let's just make sure. |
| 89 DCHECK_EQ(frames, last_frame_count_); | 89 DCHECK_EQ(frames, last_frame_count_); |
| 90 | 90 |
| 91 // Copy the channel data from what we received from |read_cb_|. | 91 // Copy the channel data from what we received from |read_cb_|. |
| 92 memcpy(destination, resampler_audio_bus_->channel(channel), | 92 memcpy(destination, resampler_audio_bus_->channel(channel), |
| 93 sizeof(*resampler_audio_bus_->channel(channel)) * frames); | 93 sizeof(*resampler_audio_bus_->channel(channel)) * frames); |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 void MultiChannelResampler::Flush() { |
| 98 last_frame_count_ = 0; |
| 99 for (size_t i = 0; i < resamplers_.size(); ++i) |
| 100 resamplers_[i]->Flush(); |
| 101 } |
| 102 |
| 97 } // namespace media | 103 } // namespace media |
| OLD | NEW |