diff --git a/webrtc/modules/audio_coding/neteq4/interface/neteq.h b/webrtc/modules/audio_coding/neteq4/interface/neteq.h index 59e5bab05a..89051275e4 100644 --- a/webrtc/modules/audio_coding/neteq4/interface/neteq.h +++ b/webrtc/modules/audio_coding/neteq4/interface/neteq.h @@ -164,9 +164,6 @@ class NetEq { // Not implemented. virtual int CurrentDelay() = 0; - // Enables playout of DTMF tones. - virtual int EnableDtmf() = 0; - // Sets the playout mode to |mode|. virtual void SetPlayoutMode(NetEqPlayoutMode mode) = 0; diff --git a/webrtc/modules/audio_coding/neteq4/neteq_impl.cc b/webrtc/modules/audio_coding/neteq4/neteq_impl.cc index 98cc19cdde..8a286a02e4 100644 --- a/webrtc/modules/audio_coding/neteq4/neteq_impl.cc +++ b/webrtc/modules/audio_coding/neteq4/neteq_impl.cc @@ -85,7 +85,6 @@ NetEqImpl::NetEqImpl(int fs, current_cng_rtp_payload_type_(0xFF), // Invalid RTP payload type. ssrc_(0), first_packet_(true), - dtmf_enabled_(true), error_code_(0), decoder_error_code_(0), crit_sect_(CriticalSectionWrapper::CreateCriticalSection()) { @@ -247,12 +246,6 @@ bool NetEqImpl::SetExtraDelay(int extra_delay_ms) { return false; } -int NetEqImpl::EnableDtmf() { - CriticalSectionScoped lock(crit_sect_); - dtmf_enabled_ = true; - return kOK; -} - void NetEqImpl::SetPlayoutMode(NetEqPlayoutMode mode) { CriticalSectionScoped lock(crit_sect_); if (!decision_logic_.get() || mode != decision_logic_->playout_mode()) { @@ -448,24 +441,22 @@ int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header, assert(current_packet); assert(current_packet->payload); if (decoder_database_->IsDtmf(current_packet->header.payloadType)) { - if (dtmf_enabled_) { - DtmfEvent event; - int ret = DtmfBuffer::ParseEvent( - current_packet->header.timestamp, - current_packet->payload, - current_packet->payload_length, - &event); - if (ret != DtmfBuffer::kOK) { - LOG_FERR2(LS_WARNING, ParseEvent, ret, - current_packet->payload_length); - PacketBuffer::DeleteAllPackets(&packet_list); - return kDtmfParsingError; - } - if (dtmf_buffer_->InsertEvent(event) != DtmfBuffer::kOK) { - LOG_FERR0(LS_WARNING, InsertEvent); - PacketBuffer::DeleteAllPackets(&packet_list); - return kDtmfInsertError; - } + DtmfEvent event; + int ret = DtmfBuffer::ParseEvent( + current_packet->header.timestamp, + current_packet->payload, + current_packet->payload_length, + &event); + if (ret != DtmfBuffer::kOK) { + LOG_FERR2(LS_WARNING, ParseEvent, ret, + current_packet->payload_length); + PacketBuffer::DeleteAllPackets(&packet_list); + return kDtmfParsingError; + } + if (dtmf_buffer_->InsertEvent(event) != DtmfBuffer::kOK) { + LOG_FERR0(LS_WARNING, InsertEvent); + PacketBuffer::DeleteAllPackets(&packet_list); + return kDtmfInsertError; } // TODO(hlundin): Let the destructor of Packet handle the payload. delete [] current_packet->payload; diff --git a/webrtc/modules/audio_coding/neteq4/neteq_impl.h b/webrtc/modules/audio_coding/neteq4/neteq_impl.h index cdc416477e..e0e31cef76 100644 --- a/webrtc/modules/audio_coding/neteq4/neteq_impl.h +++ b/webrtc/modules/audio_coding/neteq4/neteq_impl.h @@ -113,9 +113,6 @@ class NetEqImpl : public webrtc::NetEq { virtual int CurrentDelay() { return kNotImplemented; } - // Enables playout of DTMF tones. - virtual int EnableDtmf(); - // Sets the playout mode to |mode|. virtual void SetPlayoutMode(NetEqPlayoutMode mode); @@ -316,7 +313,6 @@ class NetEqImpl : public webrtc::NetEq { uint8_t current_cng_rtp_payload_type_; uint32_t ssrc_; bool first_packet_; - bool dtmf_enabled_; int error_code_; // Store last error code. int decoder_error_code_; CriticalSectionWrapper* crit_sect_; diff --git a/webrtc/modules/audio_coding/neteq4/tools/neteq_rtpplay.cc b/webrtc/modules/audio_coding/neteq4/tools/neteq_rtpplay.cc index c5abdf7a16..491dc77bde 100644 --- a/webrtc/modules/audio_coding/neteq4/tools/neteq_rtpplay.cc +++ b/webrtc/modules/audio_coding/neteq4/tools/neteq_rtpplay.cc @@ -151,7 +151,6 @@ int main(int argc, char* argv[]) { int sample_rate_hz = 16000; NetEq* neteq = NetEq::Create(sample_rate_hz); RegisterPayloadTypes(neteq); - neteq->EnableDtmf(); // Read first packet. NETEQTEST_RTPpacket *rtp;