Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: webrtc/modules/audio_coding/neteq/neteq_impl.cc

Issue 1334303005: Returning correct duration estimate on Opus DTX packets. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/neteq/neteq_impl.cc
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
index e6f7e60dbdafb5e29738b3ebf8f9b1379e977851..d6a61763df7168f766ca4fed6e9f2456dbb474ff 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
@@ -1645,21 +1645,23 @@ int NetEqImpl::DoRfc3389Cng(PacketList* packet_list, bool play_dtmf) {
void NetEqImpl::DoCodecInternalCng() {
int length = 0;
- // TODO(hlundin): Will probably need a longer buffer for multi-channel.
- int16_t decoded_buffer[kMaxFrameSize];
AudioDecoder* decoder = decoder_database_->GetActiveDecoder();
if (decoder) {
const uint8_t* dummy_payload = NULL;
AudioDecoder::SpeechType speech_type;
length = decoder->Decode(
- dummy_payload, 0, fs_hz_, kMaxFrameSize * sizeof(int16_t),
- decoded_buffer, &speech_type);
+ dummy_payload, 0, fs_hz_, decoded_buffer_length_ * sizeof(int16_t),
+ decoded_buffer_.get(), &speech_type);
}
assert(mute_factor_array_.get());
- normal_->Process(decoded_buffer, length, last_mode_, mute_factor_array_.get(),
- algorithm_buffer_.get());
- last_mode_ = kModeCodecInternalCng;
- expand_->Reset();
+ if (length > 0) {
hlundin-webrtc 2015/09/15 13:05:09 I think you'll have to handle the error differentl
minyue-webrtc 2015/09/16 08:05:31 May I suggest yet another solution? When normal de
+ normal_->Process(decoded_buffer_.get(), length, last_mode_,
+ mute_factor_array_.get(), algorithm_buffer_.get());
+ last_mode_ = kModeCodecInternalCng;
+ expand_->Reset();
+ } else {
+ LOG(LS_WARNING) << "Codec internal Cng decode error.";
+ }
}
int NetEqImpl::DoDtmf(const DtmfEvent& dtmf_event, bool* play_dtmf) {

Powered by Google App Engine
This is Rietveld 408576698