OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/audio_buffer.h" | 5 #include "media/base/audio_buffer.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 case kSampleFormatS32: | 281 case kSampleFormatS32: |
282 case kSampleFormatF32: { | 282 case kSampleFormatF32: { |
283 // Interleaved data can be shifted all at once. | 283 // Interleaved data can be shifted all at once. |
284 const int frame_size = channel_count_ * bytes_per_channel; | 284 const int frame_size = channel_count_ * bytes_per_channel; |
285 memmove(channel_data_[0] + start * frame_size, | 285 memmove(channel_data_[0] + start * frame_size, |
286 channel_data_[0] + end * frame_size, | 286 channel_data_[0] + end * frame_size, |
287 frame_size * frames_to_copy); | 287 frame_size * frames_to_copy); |
288 break; | 288 break; |
289 } | 289 } |
290 case kUnknownSampleFormat: | 290 case kUnknownSampleFormat: |
| 291 case kSampleFormatAc3: |
| 292 case kSampleFormatEac3: |
291 NOTREACHED() << "Invalid sample format!"; | 293 NOTREACHED() << "Invalid sample format!"; |
292 } | 294 } |
293 } else { | 295 } else { |
294 CHECK_EQ(frames_to_copy, 0); | 296 CHECK_EQ(frames_to_copy, 0); |
295 } | 297 } |
296 | 298 |
297 // Trim the leftover data off the end of the buffer and update duration. | 299 // Trim the leftover data off the end of the buffer and update duration. |
298 TrimEnd(frames_to_trim); | 300 TrimEnd(frames_to_trim); |
299 } | 301 } |
300 | 302 |
301 } // namespace media | 303 } // namespace media |
OLD | NEW |