Chromium Code Reviews| Index: media/test/pipeline_integration_test_base.cc |
| diff --git a/media/test/pipeline_integration_test_base.cc b/media/test/pipeline_integration_test_base.cc |
| index 71521c4f237ecc95352939333d91f1d759c7498a..ccf12ac87a41c094fb9ecbc8c8558ea9fa7c3c35 100644 |
| --- a/media/test/pipeline_integration_test_base.cc |
| +++ b/media/test/pipeline_integration_test_base.cc |
| @@ -148,9 +148,9 @@ PipelineStatus PipelineIntegrationTestBase::Start(const std::string& filename, |
| } |
| PipelineStatus PipelineIntegrationTestBase::Start(const std::string& filename, |
| - kTestType test_type) { |
| - hashing_enabled_ = test_type == kHashed; |
| - clockless_playback_ = test_type == kClockless; |
| + uint8_t test_type) { |
| + hashing_enabled_ = test_type & kHashed; |
| + clockless_playback_ = test_type & kClockless; |
| return Start(filename); |
| } |
| @@ -268,12 +268,15 @@ scoped_ptr<Renderer> PipelineIntegrationTestBase::CreateRenderer() { |
| audio_decoders.push_back( |
| new OpusAudioDecoder(message_loop_.task_runner())); |
| - AudioParameters out_params(AudioParameters::AUDIO_PCM_LOW_LATENCY, |
| - CHANNEL_LAYOUT_STEREO, |
| - 44100, |
| - 16, |
| - 512); |
| - hardware_config_.UpdateOutputConfig(out_params); |
| + // Don't allow the audio renderer to resample buffers if hashing is enabled. |
|
wolenetz
2015/07/29 21:57:27
Is AudioHash too sensitive to resampling, despite
DaleCurtis
2015/07/30 01:28:14
Possibly, the tests files are also mono, so they w
|
| + if (!hashing_enabled_) { |
| + AudioParameters out_params(AudioParameters::AUDIO_PCM_LOW_LATENCY, |
| + CHANNEL_LAYOUT_STEREO, |
| + 44100, |
| + 16, |
| + 512); |
| + hardware_config_.UpdateOutputConfig(out_params); |
| + } |
| scoped_ptr<AudioRenderer> audio_renderer(new AudioRendererImpl( |
| message_loop_.task_runner(), |
| @@ -281,7 +284,9 @@ scoped_ptr<Renderer> PipelineIntegrationTestBase::CreateRenderer() { |
| ? static_cast<AudioRendererSink*>(clockless_audio_sink_.get()) |
| : audio_sink_.get(), |
| audio_decoders.Pass(), hardware_config_, new MediaLog())); |
| - if (hashing_enabled_) |
| + if (hashing_enabled_ && clockless_playback_) |
| + clockless_audio_sink_->StartAudioHashForTesting(); |
| + else |
| audio_sink_->StartAudioHashForTesting(); |
|
wolenetz
2015/07/29 21:57:27
hmm. Previously we only hashed if |hashing_enabled
DaleCurtis
2015/07/30 01:28:14
Done.
|
| scoped_ptr<RendererImpl> renderer_impl( |
| @@ -319,6 +324,9 @@ std::string PipelineIntegrationTestBase::GetVideoHash() { |
| std::string PipelineIntegrationTestBase::GetAudioHash() { |
| DCHECK(hashing_enabled_); |
| + |
| + if (clockless_playback_) |
| + return clockless_audio_sink_->GetAudioHashForTesting(); |
| return audio_sink_->GetAudioHashForTesting(); |
| } |