| Index: webrtc/modules/audio_coding/neteq/decision_logic_fax.cc
|
| diff --git a/webrtc/modules/audio_coding/neteq/decision_logic_fax.cc b/webrtc/modules/audio_coding/neteq/decision_logic_fax.cc
|
| index ddea64425f22a7f30c7394437dcc613486e39d73..cb052b24b2f610e80506f514bd67c72ffdf4fcc4 100644
|
| --- a/webrtc/modules/audio_coding/neteq/decision_logic_fax.cc
|
| +++ b/webrtc/modules/audio_coding/neteq/decision_logic_fax.cc
|
| @@ -26,7 +26,8 @@ Operations DecisionLogicFax::GetDecisionSpecialized(
|
| const RTPHeader* packet_header,
|
| Modes prev_mode,
|
| bool play_dtmf,
|
| - bool* reset_decoder) {
|
| + bool* reset_decoder,
|
| + size_t noise_samples_played) {
|
| assert(playout_mode_ == kPlayoutFax || playout_mode_ == kPlayoutOff);
|
| uint32_t target_timestamp = sync_buffer.end_timestamp();
|
| uint32_t available_timestamp = 0;
|
| @@ -37,7 +38,7 @@ Operations DecisionLogicFax::GetDecisionSpecialized(
|
| decoder_database_->IsComfortNoise(packet_header->payloadType);
|
| }
|
| if (is_cng_packet) {
|
| - if (static_cast<int32_t>((generated_noise_samples_ + target_timestamp)
|
| + if (static_cast<int32_t>((noise_samples_played + target_timestamp)
|
| - available_timestamp) >= 0) {
|
| // Time to play this packet now.
|
| return kRfc3389Cng;
|
| @@ -70,13 +71,13 @@ Operations DecisionLogicFax::GetDecisionSpecialized(
|
| } else if (target_timestamp == available_timestamp) {
|
| return kNormal;
|
| } else {
|
| - if (static_cast<int32_t>((generated_noise_samples_ + target_timestamp)
|
| + if (static_cast<int32_t>((noise_samples_played + target_timestamp)
|
| - available_timestamp) >= 0) {
|
| return kNormal;
|
| } else {
|
| // If currently playing comfort noise, continue with that. Do not
|
| - // increase the timestamp counter since generated_noise_samples_ will
|
| - // be increased.
|
| + // increase the timestamp counter since generated_noise_stopwatch_ in
|
| + // NetEqImpl will take care of the time-keeping.
|
| if (cng_state_ == kCngRfc3389On) {
|
| return kRfc3389CngNoPacket;
|
| } else if (cng_state_ == kCngInternalOn) {
|
|
|