Reintroduce division by two for audio playout delay

When migrating the audio device, we accidentally dropped a /2 for
PlayoutDelay. This meant we would estimate a delay of 150ms instead of
75ms for JavaAudioDeviceModules. This change fixes that.

Bug: webrtc:7452
Change-Id: I20b70ebf141410209953243ae665644b92e480f5
Reviewed-on: https://webrtc-review.googlesource.com/c/113946
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25986}
This commit is contained in:
Paulina Hensman
2018-12-12 09:34:26 +01:00
committed by Commit Bot
parent e10b163dd4
commit 17d57c7c13
2 changed files with 3 additions and 3 deletions

View File

@ -747,12 +747,12 @@ TEST_F(AudioDeviceTest,
// selected audio layer. Note that, this delay estimate will only be utilized
// if the HW AEC is disabled.
TEST_F(AudioDeviceTest, UsesCorrectDelayEstimateForHighLatencyOutputPath) {
EXPECT_EQ(kHighLatencyModeDelayEstimateInMilliseconds,
EXPECT_EQ(kHighLatencyModeDelayEstimateInMilliseconds / 2,
TestDelayOnAudioLayer(AudioDeviceModule::kAndroidJavaAudio));
}
TEST_F(AudioDeviceTest, UsesCorrectDelayEstimateForLowLatencyOutputPath) {
EXPECT_EQ(kLowLatencyModeDelayEstimateInMilliseconds,
EXPECT_EQ(kLowLatencyModeDelayEstimateInMilliseconds / 2,
TestDelayOnAudioLayer(
AudioDeviceModule::kAndroidJavaInputAndOpenSLESOutputAudio));
}

View File

@ -505,7 +505,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
int32_t PlayoutDelay(uint16_t* delay_ms) const override {
// Best guess we can do is to use half of the estimated total delay.
*delay_ms = playout_delay_ms_;
*delay_ms = playout_delay_ms_ / 2;
RTC_DCHECK_GT(*delay_ms, 0);
return 0;
}