shithub: libsamplerate

Download patch

ref: ab98677064779932e58a7cc518a9d2c85a6abbb3
parent: e7aaf191434628bd1439751ec335ac1c76aade9a
author: Erik de Castro Lopo <erikd@mega-nerd.com>
date: Fri Feb 13 14:54:50 EST 2009

Fix SRC_ERR_BAD_SRC_RATIO error string. Thanks David Cournapeau.

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-02-13  Erik de Castro Lopo  <erikd AT mega-nerd DOT com>
+
+    *  src/common.h src/samplerate.c
+    Fix SRC_ERR_BAD_SRC_RATIO error string. Thanks David Cournapeau.
+
 2009-01-30  Erik de Castro Lopo  <erikd AT mega-nerd DOT com>
 
     * src/src_sinc.c
--- a/src/common.h
+++ b/src/common.h
@@ -34,6 +34,8 @@
 #endif
 
 #define	SRC_MAX_RATIO			256
+#define	SRC_MAX_RATIO_STR		"256"
+
 #define	SRC_MIN_RATIO_DIFF		(1e-20)
 
 #define	MAX(a,b)	(((a) > (b)) ? (a) : (b))
--- a/src/samplerate.c
+++ b/src/samplerate.c
@@ -226,7 +226,7 @@
 		**	returns without setting the ptr.
 		*/
 		float dummy [1] ;
-			
+
 		if (src_data.input_frames == 0)
 		{	float *ptr = dummy ;
 
@@ -392,8 +392,10 @@
 				return "SRC_DATA->data_out is NULL." ;
 		case SRC_ERR_NO_PRIVATE :
 				return "Internal error. No private data." ;
+
 		case SRC_ERR_BAD_SRC_RATIO :
-				return "SRC ratio outside [1/12, 12] range." ;
+				return "SRC ratio outside [1/" SRC_MAX_RATIO_STR ", " SRC_MAX_RATIO_STR "] range." ;
+
 		case SRC_ERR_BAD_SINC_STATE :
 				return "src_process() called without reset after end_of_input." ;
 		case SRC_ERR_BAD_PROC_PTR :