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

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

Issue 1235643003: Miscellaneous changes split from https://codereview.webrtc.org/1230503003 . (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 5 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
« no previous file with comments | « webrtc/modules/audio_coding/main/test/PCMFile.cc ('k') | webrtc/modules/audio_coding/neteq/dsp_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc
diff --git a/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc b/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc
index 99ff95a2ec1378d65bcdaa0bfa383e9f29697961..6a9b953f23a3a9d9db5f683a3820afebb9b49a2e 100644
--- a/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc
+++ b/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc
@@ -256,16 +256,14 @@ int AudioDecoderG722Stereo::DecodeInternal(const uint8_t* encoded,
static_cast<int16_t>(encoded_len / 2),
&decoded[decoded_len], &temp_type);
if (ret == decoded_len) {
- decoded_len += ret;
+ ret += decoded_len; // Return total number of samples.
// Interleave output.
- for (int k = decoded_len / 2; k < decoded_len; k++) {
+ for (int k = ret / 2; k < ret; k++) {
int16_t temp = decoded[k];
- memmove(&decoded[2 * k - decoded_len + 2],
- &decoded[2 * k - decoded_len + 1],
- (decoded_len - k - 1) * sizeof(int16_t));
- decoded[2 * k - decoded_len + 1] = temp;
+ memmove(&decoded[2 * k - ret + 2], &decoded[2 * k - ret + 1],
+ (ret - k - 1) * sizeof(int16_t));
+ decoded[2 * k - ret + 1] = temp;
}
- ret = decoded_len; // Return total number of samples.
}
}
*speech_type = ConvertSpeechType(temp_type);
« no previous file with comments | « webrtc/modules/audio_coding/main/test/PCMFile.cc ('k') | webrtc/modules/audio_coding/neteq/dsp_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698