Index: pjproject/trunk/third_party/resample/src/resamplesubs.c
===================================================================
--- pjproject/trunk/third_party/resample/src/resamplesubs.c	(revision 3085)
+++ pjproject/trunk/third_party/resample/src/resamplesubs.c	(revision 4728)
@@ -7,5 +7,5 @@
  *
  * Snippet from the resample.1 man page:
- * 
+ *
  * HISTORY
  *
@@ -14,19 +14,19 @@
  * 1981.  It was called SRCONV and was written in SAIL for PDP-10
  * compatible machines.  The algorithm was first published in
- * 
+ *
  * Smith, Julius O. and Phil Gossett. ``A Flexible Sampling-Rate
  * Conversion Method,'' Proceedings (2): 19.4.1-19.4.4, IEEE Conference
  * on Acoustics, Speech, and Signal Processing, San Diego, March 1984.
- * 
+ *
  * An expanded tutorial based on this paper is available at the Digital
  * Audio Resampling Home Page given above.
- * 
+ *
  * Circa 1988, the SRCONV program was translated from SAIL to C by
  * Christopher Lee Fraley working with Roger Dannenberg at CMU.
- * 
+ *
  * Since then, the C version has been maintained by jos.
- * 
+ *
  * Sndlib support was added 6/99 by John Gibson <jgg9c@virginia.edu>.
- * 
+ *
  * The resample program is free software distributed in accordance
  * with the Lesser GNU Public License (LGPL).  There is NO warranty; not
@@ -78,5 +78,5 @@
 #undef INLINE
 #define INLINE
-#define HAVE_FILTER 0    
+#define HAVE_FILTER 0
 
 #ifndef NULL
@@ -95,5 +95,5 @@
     } else if (v < MIN_HWORD) {
 	v = MIN_HWORD;
-    }	
+    }
     out = (RES_HWORD) v;
     return out;
@@ -102,5 +102,5 @@
 /* Sampling rate conversion using linear interpolation for maximum speed.
  */
-static int 
+static int
   SrcLinear(const RES_HWORD X[], RES_HWORD Y[], double pFactor, RES_UHWORD nx)
 {
@@ -110,17 +110,17 @@
     RES_HWORD *Ystart, *Yend;
     RES_WORD v,x1,x2;
-    
-    double dt;                  /* Step through input signal */ 
+
+    double dt;                  /* Step through input signal */
     RES_UWORD dtb;                  /* Fixed-point version of Dt */
-    RES_UWORD endTime;              /* When time reaches EndTime, return to user */
-    
+    //RES_UWORD endTime;              /* When time reaches EndTime, return to user */
+
     dt = 1.0/pFactor;            /* Output sampling period */
     dtb = dt*(1<<Np) + 0.5;     /* Fixed-point representation */
-    
+
     Ystart = Y;
     Yend = Ystart + (unsigned)(nx * pFactor + 0.5);
-    endTime = time + (1<<Np)*(RES_WORD)nx;
-    
-    // Integer round down in dtb calculation may cause (endTime % dtb > 0), 
+    //endTime = time + (1<<Np)*(RES_WORD)nx;
+
+    // Integer round down in dtb calculation may cause (endTime % dtb > 0),
     // so it may cause resample write pass the output buffer (Y >= Yend).
     // while (time < endTime)
@@ -140,5 +140,5 @@
 }
 
-static RES_WORD FilterUp(const RES_HWORD Imp[], const RES_HWORD ImpD[], 
+static RES_WORD FilterUp(const RES_HWORD Imp[], const RES_HWORD ImpD[],
 		     RES_UHWORD Nwing, RES_BOOL Interp,
 		     const RES_HWORD *Xp, RES_HWORD Ph, RES_HWORD Inc)
@@ -149,5 +149,5 @@
     RES_HWORD a = 0;
     RES_WORD v, t;
-    
+
     v=0;
     Hp = &Imp[Ph>>Na];
@@ -179,6 +179,6 @@
 
 	  Xp += Inc;		/* Input signal step. NO CHECK ON BOUNDS */
-      } 
-    else 
+      }
+    else
       while (Hp < End) {
 	  t = *Hp;		/* Get filter coeff */
@@ -203,5 +203,5 @@
     RES_WORD v, t;
     RES_UWORD Ho;
-    
+
     v=0;
     Ho = (Ph*(RES_UWORD)dhb)>>Np;
@@ -228,5 +228,5 @@
 	  Xp += Inc;		/* Input signal step. NO CHECK ON BOUNDS */
       }
-    else 
+    else
       while ((Hp = &Imp[Ho>>Na]) < End) {
 	  t = *Hp;		/* Get IR sample */
@@ -245,5 +245,5 @@
  * Slightly faster than down-conversion;
  */
-static int SrcUp(const RES_HWORD X[], RES_HWORD Y[], double pFactor, 
+static int SrcUp(const RES_HWORD X[], RES_HWORD Y[], double pFactor,
 		 RES_UHWORD nx, RES_UHWORD pNwing, RES_UHWORD pLpScl,
 		 const RES_HWORD pImp[], const RES_HWORD pImpD[], RES_BOOL Interp)
@@ -252,18 +252,18 @@
     RES_HWORD *Ystart, *Yend;
     RES_WORD v;
-    
-    double dt;                  /* Step through input signal */ 
+
+    double dt;                  /* Step through input signal */
     RES_UWORD dtb;                  /* Fixed-point version of Dt */
     RES_UWORD time = 0;
-    RES_UWORD endTime;              /* When time reaches EndTime, return to user */
-    
+    //RES_UWORD endTime;              /* When time reaches EndTime, return to user */
+
     dt = 1.0/pFactor;            /* Output sampling period */
     dtb = dt*(1<<Np) + 0.5;     /* Fixed-point representation */
-    
+
     Ystart = Y;
     Yend = Ystart + (unsigned)(nx * pFactor + 0.5);
-    endTime = time + (1<<Np)*(RES_WORD)nx;
-
-    // Integer round down in dtb calculation may cause (endTime % dtb > 0), 
+    //endTime = time + (1<<Np)*(RES_WORD)nx;
+
+    // Integer round down in dtb calculation may cause (endTime % dtb > 0),
     // so it may cause resample write pass the output buffer (Y >= Yend).
     // while (time < endTime)
@@ -289,5 +289,5 @@
 /* Sampling rate conversion subroutine */
 
-static int SrcUD(const RES_HWORD X[], RES_HWORD Y[], double pFactor, 
+static int SrcUD(const RES_HWORD X[], RES_HWORD Y[], double pFactor,
 		 RES_UHWORD nx, RES_UHWORD pNwing, RES_UHWORD pLpScl,
 		 const RES_HWORD pImp[], const RES_HWORD pImpD[], RES_BOOL Interp)
@@ -296,22 +296,22 @@
     RES_HWORD *Ystart, *Yend;
     RES_WORD v;
-    
+
     double dh;                  /* Step through filter impulse response */
     double dt;                  /* Step through input signal */
     RES_UWORD time = 0;
-    RES_UWORD endTime;          /* When time reaches EndTime, return to user */
+    //RES_UWORD endTime;          /* When time reaches EndTime, return to user */
     RES_UWORD dhb, dtb;         /* Fixed-point versions of Dh,Dt */
-    
+
     dt = 1.0/pFactor;            /* Output sampling period */
     dtb = dt*(1<<Np) + 0.5;     /* Fixed-point representation */
-    
+
     dh = MIN(Npc, pFactor*Npc);  /* Filter sampling period */
     dhb = dh*(1<<Na) + 0.5;     /* Fixed-point representation */
-    
+
     Ystart = Y;
     Yend = Ystart + (unsigned)(nx * pFactor + 0.5);
-    endTime = time + (1<<Np)*(RES_WORD)nx;
-
-    // Integer round down in dtb calculation may cause (endTime % dtb > 0), 
+    //endTime = time + (1<<Np)*(RES_WORD)nx;
+
+    // Integer round down in dtb calculation may cause (endTime % dtb > 0),
     // so it may cause resample write pass the output buffer (Y >= Yend).
     // while (time < endTime)
@@ -332,5 +332,5 @@
 
 
-DECL(int) res_SrcLinear(const RES_HWORD X[], RES_HWORD Y[], 
+DECL(int) res_SrcLinear(const RES_HWORD X[], RES_HWORD Y[],
 		        double pFactor, RES_UHWORD nx)
 {
@@ -338,5 +338,5 @@
 }
 
-DECL(int) res_Resample(const RES_HWORD X[], RES_HWORD Y[], double pFactor, 
+DECL(int) res_Resample(const RES_HWORD X[], RES_HWORD Y[], double pFactor,
 		       RES_UHWORD nx, RES_BOOL LargeF, RES_BOOL Interp)
 {
@@ -355,9 +355,9 @@
 
 	if (LargeF)
-	    return SrcUD(X, Y, pFactor, nx, 
+	    return SrcUD(X, Y, pFactor, nx,
 			 LARGE_FILTER_NWING, LARGE_FILTER_SCALE * pFactor + 0.5,
 			 LARGE_FILTER_IMP, LARGE_FILTER_IMPD, Interp);
 	else
-	    return SrcUD(X, Y, pFactor, nx, 
+	    return SrcUD(X, Y, pFactor, nx,
 			 SMALL_FILTER_NWING, SMALL_FILTER_SCALE * pFactor + 0.5,
 			 SMALL_FILTER_IMP, SMALL_FILTER_IMPD, Interp);
@@ -369,8 +369,8 @@
 {
     if (LargeF)
-	return (LARGE_FILTER_NMULT + 1) / 2.0  *  
+	return (LARGE_FILTER_NMULT + 1) / 2.0  *
 	        MAX(1.0, 1.0/pFactor);
     else
-	return (SMALL_FILTER_NMULT + 1) / 2.0  *  
+	return (SMALL_FILTER_NMULT + 1) / 2.0  *
 		MAX(1.0, 1.0/pFactor);
 }
