NetEq: Update stats earlier in the GetAudioInternal call
This is to prepare for implementation of NetEq muted state, which may
cause GetAudioInternal to make an early return just before the call to
GetDecision. With this change, the stats are updated in any case.
BUG=webrtc:5608
NOTRY=True
Review-Url: https://codereview.webrtc.org/1948663002
Cr-Commit-Position: refs/heads/master@{#12671}
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
index 555d3c7..945ac5c 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
@@ -815,6 +815,7 @@
Operations operation;
bool play_dtmf;
tick_timer_->Increment();
+ stats_.IncreaseCounter(output_size_samples_, fs_hz_);
int return_value = GetDecision(&operation, &packet_list, &dtmf_event,
&play_dtmf);
if (return_value != 0) {
@@ -1029,9 +1030,6 @@
*play_dtmf = false;
*operation = kUndefined;
- // Increment time counters.
- stats_.IncreaseCounter(output_size_samples_, fs_hz_);
-
assert(sync_buffer_.get());
uint32_t end_timestamp = sync_buffer_->end_timestamp();
if (!new_codec_) {