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..e1454b0f5198935d763000a1ef4b88bf584f8263 100644 |
| --- a/webrtc/test/fake_audio_device.cc |
| +++ b/webrtc/test/fake_audio_device.cc |
| @@ -13,6 +13,7 @@ |
| #include <algorithm> |
| #include "testing/gtest/include/gtest/gtest.h" |
| +#include "webrtc/base/checks.h" |
|
pbos-webrtc
2016/02/09 21:08:50
Is this in use?
danilchap
2016/02/10 12:40:35
No, overlooked leftover from early thoughts. Remov
|
| #include "webrtc/base/platform_thread.h" |
| #include "webrtc/modules/media_file/media_file_utility.h" |
| #include "webrtc/system_wrappers/include/clock.h" |
| @@ -22,13 +23,17 @@ |
| namespace webrtc { |
| namespace test { |
| -FakeAudioDevice::FakeAudioDevice(Clock* clock, const std::string& filename) |
| +FakeAudioDevice::FakeAudioDevice(Clock* clock, |
| + const std::string& filename, |
| + float drift) |
| : audio_callback_(NULL), |
| capturing_(false), |
| captured_audio_(), |
| playout_buffer_(), |
| + drift_(drift), |
| last_playout_ms_(-1), |
| - clock_(clock), |
| + drifting_clock_(clock, drift), |
| + clock_(drift == 0 ? clock : &drifting_clock_), |
| tick_(EventTimerWrapper::Create()), |
| thread_(FakeAudioDevice::Run, this, "FakeAudioDevice"), |
| file_utility_(new ModuleFileUtility(0)), |
| @@ -51,7 +56,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 * (1. + drift_))) |
| return -1; |
| thread_.Start(); |
| thread_.SetPriority(rtc::kHighPriority); |