nausea

curses audio visualizer
git clone git://git.2f30.org/nausea
Log | Files | Refs | README | LICENSE

commit ff13bc155d84a2e42191a0a239a1d1507292dde9
parent 3c8a5262d63f8ca3a749d7e4aa6be3dcd3d1266e
Author: lostd <lostd@2f30.org>
Date:   Sat, 20 Jun 2015 21:16:56 +0100

Fix channel splitting loop and make it work on all window sizes

Diffstat:
Mnausea.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/nausea.c b/nausea.c @@ -587,8 +587,11 @@ draw_solid(struct frame *fr) /* compute point position */ if (stereo) { + /* round down to an even */ + if (samples_per_col % 2 != 0) + samples_per_col--; pt_l = pt_r = 0; - for (j = 0; j < samples_per_col / 2; j++) { + for (j = 0; j < samples_per_col; j += 2) { pt_l += fr->in[i * samples_per_col + j + 0]; pt_r += fr->in[i * samples_per_col + j + 1]; }