Index: webrtc/modules/audio_coding/test/TestVADDTX.cc |
diff --git a/webrtc/modules/audio_coding/test/TestVADDTX.cc b/webrtc/modules/audio_coding/test/TestVADDTX.cc |
index 98b1224762ddd6e72df426b9aaf776a2c302ed0a..6a0b270e27018853af815e864e96192ca748899f 100644 |
--- a/webrtc/modules/audio_coding/test/TestVADDTX.cc |
+++ b/webrtc/modules/audio_coding/test/TestVADDTX.cc |
@@ -12,6 +12,7 @@ |
#include <string> |
+#include "webrtc/base/checks.h" |
#include "webrtc/engine_configurations.h" |
#include "webrtc/modules/audio_coding/test/PCMFile.h" |
#include "webrtc/modules/audio_coding/test/utility.h" |
@@ -87,6 +88,12 @@ void TestVadDtx::Run(std::string in_filename, int frequency, int channels, |
PCMFile in_file; |
in_file.Open(in_filename, frequency, "rb"); |
in_file.ReadStereo(channels > 1); |
+ static const int kTestLengthMs = 1000; |
+ const int test_length_blocks = rtc::CheckedDivExact(kTestLengthMs, 10); |
+ in_file.SetNum10MsBlocksToRead(test_length_blocks); |
+ // Fast-forward both files 500 ms (50 blocks). The first second of the file is |
+ // silence, but we want to keep half of that to test silence periods. |
+ in_file.FastForward(50); |
PCMFile out_file; |
if (append) { |