Commit 4e39a2e5 authored by ods15's avatar ods15

Original Commit: r67 | ods15 | 2006-09-25 20:33:06 +0300 (Mon, 25 Sep 2006) | 2 lines

horrible off-by-one causing lots of troubles...

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@6472 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 2cb2dd5c
...@@ -847,7 +847,7 @@ static int window(venc_context_t * venc, signed short * audio, int samples) { ...@@ -847,7 +847,7 @@ static int window(venc_context_t * venc, signed short * audio, int samples) {
float * offset = venc->samples + channel*window_len*2 + window_len; float * offset = venc->samples + channel*window_len*2 + window_len;
j = channel; j = channel;
for (i = 0; i < samples; i++, j += venc->channels) for (i = 0; i < samples; i++, j += venc->channels)
offset[i] = audio[j] / 32768. * win[window_len - i] / n; offset[i] = audio[j] / 32768. / n * win[window_len - i - 1];
} }
} else { } else {
for (channel = 0; channel < venc->channels; channel++) { for (channel = 0; channel < venc->channels; channel++) {
...@@ -864,7 +864,7 @@ static int window(venc_context_t * venc, signed short * audio, int samples) { ...@@ -864,7 +864,7 @@ static int window(venc_context_t * venc, signed short * audio, int samples) {
float * offset = venc->saved + channel*window_len; float * offset = venc->saved + channel*window_len;
j = channel; j = channel;
for (i = 0; i < samples; i++, j += venc->channels) for (i = 0; i < samples; i++, j += venc->channels)
offset[i] = audio[j] / 32768. * win[i] / n; offset[i] = audio[j] / 32768. / n * win[i];
} }
venc->have_saved = 1; venc->have_saved = 1;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment