Index: /libmpc/trunk/include/mpc/mpc_types.h
===================================================================
--- /libmpc/trunk/include/mpc/mpc_types.h	(revision 298)
+++ /libmpc/trunk/include/mpc/mpc_types.h	(revision 299)
@@ -93,4 +93,8 @@
 
 #ifdef MPC_FIXED_POINT
+# define MPC_FIXED_POINT_SHIFT 16
+# define MPC_FIXED_POINT_FRACTPART 14
+# define MPC_FIXED_POINT_SCALE_SHIFT (MPC_FIXED_POINT_SHIFT + MPC_FIXED_POINT_FRACTPART)
+# define MPC_FIXED_POINT_SCALE (1 << (MPC_FIXED_POINT_SCALE_SHIFT - 1))
 typedef mpc_int32_t MPC_SAMPLE_FORMAT;
 #else
Index: /libmpc/trunk/libmpcdec/mpcdec_math.h
===================================================================
--- /libmpc/trunk/libmpcdec/mpcdec_math.h	(revision 298)
+++ /libmpc/trunk/libmpcdec/mpcdec_math.h	(revision 299)
@@ -46,7 +46,4 @@
 #endif
 
-#define MPC_FIXED_POINT_SHIFT 16
-
-
 #ifdef MPC_FIXED_POINT
 
@@ -56,10 +53,5 @@
 #endif
 
-#define MPC_FIXED_POINT_SCALE_SHIFT (MPC_FIXED_POINT_SHIFT + MPC_FIXED_POINT_FRACTPART)
-#define MPC_FIXED_POINT_SCALE (1 << (MPC_FIXED_POINT_SCALE_SHIFT - 1))
-
 //in fixedpoint mode, results in decode output buffer are in -MPC_FIXED_POINT_SCALE ... MPC_FIXED_POINT_SCALE range
-
-#define MPC_FIXED_POINT_FRACTPART 14
 
 typedef mpc_int64_t MPC_SAMPLE_FORMAT_MULTIPLY;
Index: /libmpc/trunk/mpcdec/mpcdec.c
===================================================================
--- /libmpc/trunk/mpcdec/mpcdec.c	(revision 298)
+++ /libmpc/trunk/mpcdec/mpcdec.c	(revision 299)
@@ -112,7 +112,20 @@
         sum           += end - begin;
 
-        if(is_wav_output)
+		if(is_wav_output) {
+#ifdef MPC_FIXED_POINT
+			mpc_int16_t tmp_buff[MPC_DECODER_BUFFER_LENGTH];
+			int i;
+			for( i = 0; i < MPC_DECODER_BUFFER_LENGTH; i++) {
+				int tmp = sample_buffer[i] >> MPC_FIXED_POINT_FRACTPART;
+				if (tmp > ((1 << 15) - 1)) tmp = ((1 << 15) - 1);
+				if (tmp < -(1 << 15)) tmp = -(1 << 15);
+				tmp_buff[i] = tmp;
+			}
+			if(waveformat_output_process_int16(&wav_output, tmp_buff, frame.samples*2) < 0)
+#else
             if(waveformat_output_process_float32(&wav_output, sample_buffer, frame.samples*2) < 0)
+#endif
                 break;
+		}
     }
 
