shithub: libsamplerate

Download patch

ref: 9575c5eafceef980db0e44bd31077b2d5326d11c
parent: 32a06fea3c26fb907291f14bd86b845a46b912e9
author: Erik de Castro Lopo <erikd@miles>
date: Tue Aug 2 07:16:12 EDT 2005

src_(zoh|linear).c : Fix updating of input_index.

--- a/src/src_linear.c
+++ b/src/src_linear.c
@@ -117,7 +117,7 @@
 		} ;
 
 	if (linear->in_used > linear->in_count)
-	{	input_index += linear->in_used - linear->in_count ;
+	{	input_index += (linear->in_used - linear->in_count) / linear->channels ;
 		linear->in_used = linear->in_count ;
 		} ;
 
--- a/src/src_zoh.c
+++ b/src/src_zoh.c
@@ -109,7 +109,7 @@
 		} ;
 
 	if (zoh->in_used > zoh->in_count)
-	{	input_index += zoh->in_used - zoh->in_count ;
+	{	input_index += (zoh->in_used - zoh->in_count) / zoh->channels ;
 		zoh->in_used = zoh->in_count ;
 		} ;