Fixed time moving backwards in the AudioCodingModule.

There was a fast path in PreprocessToAddData that would just use the
input timestamps if the input format was equal to the required format of
the encoder. This works well as long as the codec never changes. If we
are first doing resampling (specifically upsampling) and then change to
a codec that does not require resampling, we'll need to stick to
whatever input timestamp we left off at, rather than silently accepting
whatever we're sent.

BUG=622435

Review-Url: https://codereview.webrtc.org/2119393002
Cr-Commit-Position: refs/heads/master@{#13398}
This commit is contained in:
ossu
2016-07-06 09:34:22 -07:00
committed by Commit bot
parent 1d4fefbbaf
commit 63fb95a68d
4 changed files with 23 additions and 6 deletions

View File

@ -101,12 +101,11 @@ void TestVadDtx::Run(std::string in_filename, int frequency, int channels,
}
uint16_t frame_size_samples = in_file.PayloadLength10Ms();
uint32_t time_stamp = 0x12345678;
AudioFrame audio_frame;
while (!in_file.EndOfFile()) {
in_file.Read10MsData(audio_frame);
audio_frame.timestamp_ = time_stamp;
time_stamp += frame_size_samples;
audio_frame.timestamp_ = time_stamp_;
time_stamp_ += frame_size_samples;
EXPECT_GE(acm_send_->Add10MsData(audio_frame), 0);
bool muted;
acm_receive_->PlayoutData10Ms(kOutputFreqHz, &audio_frame, &muted);

View File

@ -72,6 +72,7 @@ class TestVadDtx : public ACMTest {
std::unique_ptr<AudioCodingModule> acm_receive_;
std::unique_ptr<Channel> channel_;
std::unique_ptr<ActivityMonitor> monitor_;
uint32_t time_stamp_ = 0x12345678;
};
// TestWebRtcVadDtx is to verify that the WebRTC VAD/DTX perform as they should.