From f4e5e657b81fd39fc2ca9b24a03d2353bdcba3b1 Mon Sep 17 00:00:00 2001 From: Oded Shimon Date: Mon, 2 Oct 2006 05:56:37 +0000 Subject: [PATCH] Original Commit: r44 | ods15 | 2006-09-23 10:54:43 +0300 (Sat, 23 Sep 2006) | 2 lines some bug fixes for window() Originally committed as revision 6452 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/vorbis_enc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/vorbis_enc.c b/libavcodec/vorbis_enc.c index bc4bef24f1..7f918e6409 100644 --- a/libavcodec/vorbis_enc.c +++ b/libavcodec/vorbis_enc.c @@ -633,7 +633,7 @@ static int window(venc_context_t * venc, signed short * audio, int samples) { if (samples) { for (channel = 0; channel < venc->channels; channel++) { - float * offset = venc->saved + channel*window_len*2 + window_len; + float * offset = venc->samples + channel*window_len*2 + window_len; j = channel; for (i = 0; i < samples; i++, j += venc->channels) offset[i] = audio[j] / 32768. * win[window_len - i]; @@ -650,9 +650,10 @@ static int window(venc_context_t * venc, signed short * audio, int samples) { if (samples) { for (channel = 0; channel < venc->channels; channel++) { + float * offset = venc->saved + channel*window_len; j = channel; for (i = 0; i < samples; i++, j += venc->channels) - venc->saved[i] = audio[j] / 32768. * win[i]; + offset[i] = audio[j] / 32768. * win[i]; } venc->have_saved = 1; } else {