Chromium Code Reviews| Index: webrtc/test/fake_audio_device.cc |
| diff --git a/webrtc/test/fake_audio_device.cc b/webrtc/test/fake_audio_device.cc |
| index 31cebda6521a01455fbe17f5b789423d296aa82e..0381981c207a191b74a669ef1881133f80208443 100644 |
| --- a/webrtc/test/fake_audio_device.cc |
| +++ b/webrtc/test/fake_audio_device.cc |
| @@ -22,13 +22,17 @@ |
| namespace webrtc { |
| namespace test { |
| -FakeAudioDevice::FakeAudioDevice(Clock* clock, const std::string& filename) |
| +FakeAudioDevice::FakeAudioDevice(Clock* clock, |
| + const std::string& filename, |
| + float speed) |
| : audio_callback_(NULL), |
| capturing_(false), |
| captured_audio_(), |
| playout_buffer_(), |
| + speed_(speed), |
| last_playout_ms_(-1), |
| - clock_(clock), |
| + drifting_clock_(clock, speed), |
| + clock_(speed == DriftingClock::kNoDrift ? clock : &drifting_clock_), |
|
pbos-webrtc
2016/02/10 13:28:14
Just always use the drifting clock if it's a no-op
danilchap
2016/02/10 15:50:19
Simplified. After few failed tries to explain my r
|
| tick_(EventTimerWrapper::Create()), |
| thread_(FakeAudioDevice::Run, this, "FakeAudioDevice"), |
| file_utility_(new ModuleFileUtility(0)), |
| @@ -51,7 +55,7 @@ int32_t FakeAudioDevice::Init() { |
| if (file_utility_->InitPCMReading(*input_stream_.get()) != 0) |
| return -1; |
| - if (!tick_->StartTimer(true, 10)) |
| + if (!tick_->StartTimer(true, 10 / speed_)) |
| return -1; |
| thread_.Start(); |
| thread_.SetPriority(rtc::kHighPriority); |