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

Unified Diff: media/base/test_helpers.cc

Issue 259453003: Introduce AudioDiscardHelper. Refactor audio decoders to use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix x64 type. Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/audio_discard_helper_unittest.cc ('k') | media/filters/ffmpeg_audio_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/test_helpers.cc
diff --git a/media/base/test_helpers.cc b/media/base/test_helpers.cc
index fd571ddc689c43eda8c746c248540bff64143af7..98d4971795a05291c96a31a7ae600fb681acfee6 100644
--- a/media/base/test_helpers.cc
+++ b/media/base/test_helpers.cc
@@ -185,9 +185,9 @@ scoped_refptr<AudioBuffer> MakeAudioBuffer(SampleFormat format,
output->channel_data().size() == 1 ? frames * channels : frames;
for (size_t ch = 0; ch < output->channel_data().size(); ++ch) {
T* buffer = reinterpret_cast<T*>(output->channel_data()[ch]);
+ const T v = static_cast<T>(start + ch * output_size * increment);
for (size_t i = 0; i < output_size; ++i) {
- buffer[i] = start;
- start += increment;
+ buffer[i] = static_cast<T>(v + i * increment);
}
}
return output;
« no previous file with comments | « media/base/audio_discard_helper_unittest.cc ('k') | media/filters/ffmpeg_audio_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698