ref: a852e9fbfd7c360e9078d124e73ec6eef2665148
parent: c950e076e03cfa839bd3120dc3914c22d351a16a
author: Jean-Marc Valin <jmvalin@jmvalin.ca>
date: Wed Sep 26 19:04:44 EDT 2018
Fixes a gapless buffering bug Thanks to Dmitry for reporting the bug.
--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -713,7 +713,7 @@
int i;
if (samples_per_channel < LPC_INPUT) {
for (i=0;i<(LPC_INPUT-samples_per_channel)*channels;i++) enc->lpc_buffer[i] = enc->lpc_buffer[samples_per_channel*channels + i];
- for (i=0;i<samples_per_channel*channels;i++) enc->lpc_buffer[(LPC_INPUT-samples_per_channel)*channels] = pcm[i];
+ for (i=0;i<samples_per_channel*channels;i++) enc->lpc_buffer[(LPC_INPUT-samples_per_channel)*channels + i] = pcm[i];
} else {
for (i=0;i<LPC_INPUT*channels;i++) enc->lpc_buffer[i] = pcm[(samples_per_channel-LPC_INPUT)*channels + i];
}