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

Unified Diff: media/filters/decrypting_audio_decoder_unittest.cc

Issue 212103013: Add channel_count parameter back to AudioBuffer creation methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mstr
Patch Set: fix unit test Created 6 years, 9 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/filters/audio_renderer_impl_unittest.cc ('k') | media/filters/ffmpeg_audio_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/decrypting_audio_decoder_unittest.cc
diff --git a/media/filters/decrypting_audio_decoder_unittest.cc b/media/filters/decrypting_audio_decoder_unittest.cc
index 777db6f5ebf589f0a364cb84bc6a6a9bce611081..c711cbd92a1474bfdf7b71dae3fac8f917a14f5e 100644
--- a/media/filters/decrypting_audio_decoder_unittest.cc
+++ b/media/filters/decrypting_audio_decoder_unittest.cc
@@ -94,7 +94,14 @@ class DecryptingAudioDecoderTest : public testing::Test {
void InitializeAndExpectStatus(const AudioDecoderConfig& config,
PipelineStatus status) {
+ // Initialize data now that the config is known. Since the code uses
+ // invalid values (that CreateEmptyBuffer() doesn't support), tweak them
+ // just for CreateEmptyBuffer().
+ int channels = ChannelLayoutToChannelCount(config.channel_layout());
+ if (channels < 0)
+ channels = 0;
decoded_frame_ = AudioBuffer::CreateEmptyBuffer(config.channel_layout(),
+ channels,
kSampleRate,
kFakeAudioFrameSize,
kNoTimestamp(),
@@ -353,12 +360,14 @@ TEST_F(DecryptingAudioDecoderTest, DecryptAndDecode_MultipleFrames) {
scoped_refptr<AudioBuffer> frame_a = AudioBuffer::CreateEmptyBuffer(
config_.channel_layout(),
+ ChannelLayoutToChannelCount(config_.channel_layout()),
kSampleRate,
kFakeAudioFrameSize,
kNoTimestamp(),
kNoTimestamp());
scoped_refptr<AudioBuffer> frame_b = AudioBuffer::CreateEmptyBuffer(
config_.channel_layout(),
+ ChannelLayoutToChannelCount(config_.channel_layout()),
kSampleRate,
kFakeAudioFrameSize,
kNoTimestamp(),
« no previous file with comments | « media/filters/audio_renderer_impl_unittest.cc ('k') | media/filters/ffmpeg_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698