# HG changeset patch # User michaelni # Date 1031396271 0 # Node ID 5a8f80522cf8db4330d92f2c3ad43880f9ed36c4 # Parent dddcff6841f28601b255355860018d45e49f9ffd fixing overflow in 16->8 bit conversion, patch by (Nikolai Zhubr ) diff -r dddcff6841f2 -r 5a8f80522cf8 pcm.c --- a/pcm.c Sat Sep 07 00:16:30 2002 +0000 +++ b/pcm.c Sat Sep 07 10:57:51 2002 +0000 @@ -209,14 +209,14 @@ case CODEC_ID_PCM_S8: for(;n>0;n--) { v = *samples++; - dst[0] = (v + 128) >> 8; + dst[0] = v >> 8; dst++; } break; case CODEC_ID_PCM_U8: for(;n>0;n--) { v = *samples++; - dst[0] = ((v + 128) >> 8) + 128; + dst[0] = (v >> 8) + 128; dst++; } break;