shithub: sox

Download patch

ref: 9b8757eabebe9ae91d613d3c6a6ce5f00fd766ed
parent: 55f8f1eaab58a32d29a804559b45b50ab10070b6
author: cbagwell <cbagwell>
date: Fri Dec 3 12:12:30 EST 1999

We will now only override the OSS sample rates if they are more then
10% different then the user requested rate.

--- a/src/oss.c
+++ b/src/oss.c
@@ -113,9 +113,11 @@
     ioctl (fileno(ft->fp), SNDCTL_DSP_SPEED, &tmp);
     if (ft->info.rate != tmp) {
 	if (ft->info.rate - tmp > tmp/10 || tmp - ft->info.rate > tmp/10)
+	{
 	    warn("Unable to set audio speed to %d (set to %d)",
 		     ft->info.rate, tmp);
-	ft->info.rate = tmp;
+	    ft->info.rate = tmp;
+	}
     }
 
     /* Change to unbuffered mode*/
@@ -200,9 +202,11 @@
     ioctl (fileno(ft->fp), SNDCTL_DSP_SPEED, &tmp);
     if (ft->info.rate != tmp) {
 	if (ft->info.rate - tmp > tmp/10 || tmp - ft->info.rate > tmp/10)
+	{
 	    warn("Unable to set audio speed to %d (set to %d)",
 		     ft->info.rate, tmp);
-	ft->info.rate = tmp;
+	    ft->info.rate = tmp;
+	}
     }
 
     /* Change to non-buffered I/O */