From 4f2a4a12df8b00fd14c0e153e2e88d2d772fa01e Mon Sep 17 00:00:00 2001 From: Henrik Lundin Date: Fri, 26 Jan 2018 17:32:56 +0100 Subject: [PATCH] NetEq: Make the fix for Opus DTX permanent This change makes the fix for too long delays during Opus DTX periods permanent. The fix has up until now been under an experiment, named WebRTC-NetEqOpusDtxDelayFix. Bug: webrtc:8488,chromium:780849 Change-Id: I006abb67f96d9d7880bf2215d7d6b52db6cbbfbc Reviewed-on: https://webrtc-review.googlesource.com/44420 Reviewed-by: Ivo Creusen Commit-Queue: Henrik Lundin Cr-Commit-Position: refs/heads/master@{#21786} --- modules/audio_coding/neteq/neteq_impl.cc | 9 +++------ modules/audio_coding/neteq/neteq_impl.h | 1 - modules/audio_coding/neteq/neteq_unittest.cc | 16 +--------------- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/modules/audio_coding/neteq/neteq_impl.cc b/modules/audio_coding/neteq/neteq_impl.cc index 6836c7e59a..85e3690c9d 100644 --- a/modules/audio_coding/neteq/neteq_impl.cc +++ b/modules/audio_coding/neteq/neteq_impl.cc @@ -103,9 +103,7 @@ NetEqImpl::NetEqImpl(const NetEq::Config& config, playout_mode_(config.playout_mode), enable_fast_accelerate_(config.enable_fast_accelerate), nack_enabled_(false), - enable_muted_state_(config.enable_muted_state), - use_dtx_delay_fix_( - field_trial::IsEnabled("WebRTC-NetEqOpusDtxDelayFix")) { + enable_muted_state_(config.enable_muted_state) { RTC_LOG(LS_INFO) << "NetEq config: " << config.ToString(); int fs = config.sample_rate_hz; if (fs != 8000 && fs != 16000 && fs != 32000 && fs != 48000) { @@ -877,9 +875,8 @@ int NetEqImpl::GetAudioInternal(AudioFrame* audio_frame, bool* muted) { // This is the criterion that we did decode some data through the speech // decoder, and the operation resulted in comfort noise. const bool codec_internal_sid_frame = - use_dtx_delay_fix_ ? (speech_type == AudioDecoder::kComfortNoise && - start_num_packets > packet_list.size()) - : (speech_type == AudioDecoder::kComfortNoise); + (speech_type == AudioDecoder::kComfortNoise && + start_num_packets > packet_list.size()); if (sid_frame_available || codec_internal_sid_frame) { // Start a new stopwatch since we are decoding a new CNG packet. diff --git a/modules/audio_coding/neteq/neteq_impl.h b/modules/audio_coding/neteq/neteq_impl.h index a922bcdcd6..bdeb0206d6 100644 --- a/modules/audio_coding/neteq/neteq_impl.h +++ b/modules/audio_coding/neteq/neteq_impl.h @@ -440,7 +440,6 @@ class NetEqImpl : public webrtc::NetEq { std::unique_ptr generated_noise_stopwatch_ RTC_GUARDED_BY(crit_sect_); std::vector last_decoded_timestamps_ RTC_GUARDED_BY(crit_sect_); - const bool use_dtx_delay_fix_ RTC_GUARDED_BY(crit_sect_); private: RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl); diff --git a/modules/audio_coding/neteq/neteq_unittest.cc b/modules/audio_coding/neteq/neteq_unittest.cc index ef31f4b56e..ca93cf5533 100644 --- a/modules/audio_coding/neteq/neteq_unittest.cc +++ b/modules/audio_coding/neteq/neteq_unittest.cc @@ -529,20 +529,6 @@ TEST_F(NetEqDecodingTest, MAYBE_TestOpusBitExactness) { FLAG_gen_ref); } -// This test fixture is identical to NetEqDecodingTest, except that it enables -// the WebRTC-NetEqOpusDtxDelayFix field trial. -// TODO(bugs.webrtc.org/8488): When the field trial is over and the feature is -// default enabled, remove this fixture class and let the -// TestOpusDtxBitExactness test build directly on NetEqDecodingTest. -class NetEqDecodingTestWithOpusDtxFieldTrial : public NetEqDecodingTest { - public: - NetEqDecodingTestWithOpusDtxFieldTrial() - : override_field_trials_("WebRTC-NetEqOpusDtxDelayFix/Enabled/") {} - - private: - test::ScopedFieldTrials override_field_trials_; -}; - #if !defined(WEBRTC_IOS) && \ defined(WEBRTC_NETEQ_UNITTEST_BITEXACT) && \ defined(WEBRTC_CODEC_OPUS) @@ -550,7 +536,7 @@ class NetEqDecodingTestWithOpusDtxFieldTrial : public NetEqDecodingTest { #else #define MAYBE_TestOpusDtxBitExactness DISABLED_TestOpusDtxBitExactness #endif -TEST_F(NetEqDecodingTestWithOpusDtxFieldTrial, MAYBE_TestOpusDtxBitExactness) { +TEST_F(NetEqDecodingTest, MAYBE_TestOpusDtxBitExactness) { const std::string input_rtp_file = webrtc::test::ResourcePath("audio_coding/neteq_opus_dtx", "rtp");