1# Patch by James Tappin <james@xena.uklinux.net>
2# Rediffed into unified format. [dk]
3#PATCHOPTIONS: -p1
4diff -ur gramofile-1.6.orig/signpr_cmf2.c gramofile-1.6/signpr_cmf2.c
5--- gramofile-1.6.orig/signpr_cmf2.c	Sat May  5 16:07:15 2001
6+++ gramofile-1.6/signpr_cmf2.c	Fri Jun  8 10:35:39 2001
7@@ -646,19 +646,25 @@
8
9   /* Should be /64, but the signal is extremely soft, so divide by less to
10      get more quantization levels (more accurate) */
11-  sum.left /= 10;
12-  sum.right /= 10;
13+  sum.left /= 4;
14+  sum.right /= 4;
15 #endif
16
17-  if (sum.left < 32767)
18-    sample.left = sum.left;
19-  else
20+  if (sum.left > 32767)
21     sample.left = 32767;
22-
23-  if (sum.right < 32767)
24-    sample.right = sum.right;
25+  else if (sum.left < -32768)
26+    sample.left = -32768;
27   else
28+    sample.left = sum.left;
29+
30+
31+  if (sum.right > 32767)
32     sample.right = 32767;
33+  else if (sum.right < -32768)
34+    sample.right = -32768;
35+  else
36+    sample.right = sum.right;
37+
38
39   return sample;
40 }
41@@ -762,6 +768,9 @@
42     b_t.left;
43   if (i > 32767)
44     i = 32767;
45+  else if (i < -32768)
46+    i = -32768;
47+
48   returnval.left = i;
49
50   i = (labs (w_t.right - b_t.right) * 1000)
51@@ -769,6 +778,8 @@
52     b_t.right;
53   if (i > 32767)
54     i = 32767;
55+  else if (i < -32768)
56+    i = -32768;
57   returnval.right = i;
58
59   return returnval;
60