Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: media/base/audio_bus.cc

Issue 11086009: Prevent AudioLowLatencyInputMac from changing frame sizes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Typo fix. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/audio/mac/audio_low_latency_output_mac.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/audio_bus.h" 5 #include "media/base/audio_bus.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "media/audio/audio_parameters.h" 10 #include "media/audio/audio_parameters.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 ToInterleavedInternal<int32, int64>(this, frames, dest); 283 ToInterleavedInternal<int32, int64>(this, frames, dest);
284 break; 284 break;
285 default: 285 default:
286 NOTREACHED() << "Unsupported bytes per sample encountered."; 286 NOTREACHED() << "Unsupported bytes per sample encountered.";
287 memset(dest, 0, frames * bytes_per_sample); 287 memset(dest, 0, frames * bytes_per_sample);
288 return; 288 return;
289 } 289 }
290 } 290 }
291 291
292 void AudioBus::CopyTo(AudioBus* dest) const { 292 void AudioBus::CopyTo(AudioBus* dest) const {
293 DCHECK_EQ(channels(), dest->channels()); 293 CHECK_EQ(channels(), dest->channels());
294 DCHECK_EQ(frames(), dest->frames()); 294 CHECK_EQ(frames(), dest->frames());
295 295
296 // Since we don't know if the other AudioBus is wrapped or not (and we don't 296 // Since we don't know if the other AudioBus is wrapped or not (and we don't
297 // want to care), just copy using the public channel() accessors. 297 // want to care), just copy using the public channel() accessors.
298 for (int i = 0; i < channels(); ++i) 298 for (int i = 0; i < channels(); ++i)
299 memcpy(dest->channel(i), channel(i), sizeof(*channel(i)) * frames()); 299 memcpy(dest->channel(i), channel(i), sizeof(*channel(i)) * frames());
300 } 300 }
301 301
302 } // namespace media 302 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/mac/audio_low_latency_output_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698