diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-03-04 20:45:49 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-03-04 20:45:49 +0000 |
commit | 4893e94dae7ee3a2c126df6e82f732223becefce (patch) | |
tree | 3e76b98631862dab38f80d76c2ab4fe3ba1ba2ca /src/pcm_utils.c | |
parent | 0d22fa6e64ab7586c7f2ff51d66c098d6d50922b (diff) |
git-svn-id: https://svn.musicpd.org/mpd/trunk@194 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/pcm_utils.c')
-rw-r--r-- | src/pcm_utils.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/pcm_utils.c b/src/pcm_utils.c index 6f92969ac..e7d767972 100644 --- a/src/pcm_utils.c +++ b/src/pcm_utils.c @@ -96,8 +96,7 @@ void pcm_add(char * buffer1, char * buffer2, size_t bufferSize1, switch(format->bits) { case 16: while(bufferSize1>0 && bufferSize2>0) { - temp32 = *buffer16_1; - temp32+= *buffer16_2; + temp32 = *buffer16_1+*buffer16_2; *buffer16_1 = temp32>32767 ? 32767 : (temp32<-32768 ? -32768 : temp32); buffer16_1++; @@ -105,12 +104,11 @@ void pcm_add(char * buffer1, char * buffer2, size_t bufferSize1, bufferSize1-=2; bufferSize2-=2; } - if(bufferSize2>0) memcpy(buffer8_1,buffer8_2,bufferSize2); + if(bufferSize2>0) memcpy(buffer16_1,buffer16_2,bufferSize2); break; case 8: while(bufferSize1>0 && bufferSize2>0) { - temp32 = *buffer8_1; - temp32+= *buffer8_2; + temp32 = *buffer8_1+*buffer8_2; *buffer8_1 = temp32>127 ? 127 : (temp32<-128 ? -128 : temp32); buffer8_1++; |