diff options
author | Avuton Olrich <avuton@gmail.com> | 2006-07-14 20:08:35 +0000 |
---|---|---|
committer | Avuton Olrich <avuton@gmail.com> | 2006-07-14 20:08:35 +0000 |
commit | a8938c91ba2f65ad9c1c33b2d8a6ee252ff6974a (patch) | |
tree | d87e581eb410738c022013fcfd96490ceec823e2 /src | |
parent | 2a4a75d9c72ef7b695c6e70af16daf841ec96848 (diff) | |
download | mpd-a8938c91ba2f65ad9c1c33b2d8a6ee252ff6974a.tar.gz mpd-a8938c91ba2f65ad9c1c33b2d8a6ee252ff6974a.tar.xz mpd-a8938c91ba2f65ad9c1c33b2d8a6ee252ff6974a.zip |
[CLEANUP] Remove unused function
Cleanup whitespace->tabs
git-svn-id: https://svn.musicpd.org/mpd/trunk@4338 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r-- | src/pcm_utils.c | 63 | ||||
-rw-r--r-- | src/pcm_utils.h | 2 |
2 files changed, 24 insertions, 41 deletions
diff --git a/src/pcm_utils.c b/src/pcm_utils.c index c7bcaa208..74846387b 100644 --- a/src/pcm_utils.c +++ b/src/pcm_utils.c @@ -26,21 +26,6 @@ #include <math.h> #include <assert.h> -void pcm_changeBufferEndianness(char * buffer, int bufferSize, int bits) { - char temp; - - switch(bits) { - case 16: - while(bufferSize) { - temp = *buffer; - *buffer = *(buffer+1); - *(buffer+1) = temp; - bufferSize-=2; - } - break; - } -} - void pcm_volumeChange(char * buffer, int bufferSize, AudioFormat * format, int volume) { @@ -85,7 +70,7 @@ void pcm_volumeChange(char * buffer, int bufferSize, AudioFormat * format, } } -void pcm_add(char * buffer1, char * buffer2, size_t bufferSize1, +static void pcm_add(char * buffer1, char * buffer2, size_t bufferSize1, size_t bufferSize2, int vol1, int vol2, AudioFormat * format) { mpd_sint32 temp32; @@ -242,40 +227,40 @@ void pcm_convertAudioFormat(AudioFormat * inFormat, char * inBuffer, size_t else { /* only works if outFormat is 16-bit stereo! */ /* resampling code blatantly ripped from ESD */ - mpd_uint32 rd_dat = 0; - mpd_uint32 wr_dat = 0; - mpd_sint16 lsample, rsample; - mpd_sint16 * out = (mpd_sint16 *)outBuffer; - mpd_sint16 * in = (mpd_sint16 *)dataChannelConv; - const int shift = sizeof(mpd_sint16)*outFormat->channels; - mpd_uint32 nlen = ((( dataChannelLen / shift) * - (mpd_uint32)(outFormat->sampleRate)) / + mpd_uint32 rd_dat = 0; + mpd_uint32 wr_dat = 0; + mpd_sint16 lsample, rsample; + mpd_sint16 * out = (mpd_sint16 *)outBuffer; + mpd_sint16 * in = (mpd_sint16 *)dataChannelConv; + const int shift = sizeof(mpd_sint16)*outFormat->channels; + mpd_uint32 nlen = ((( dataChannelLen / shift) * + (mpd_uint32)(outFormat->sampleRate)) / inFormat->sampleRate); nlen *= outFormat->channels; switch(outFormat->channels) { case 1: - while( wr_dat < nlen) { - rd_dat = wr_dat * inFormat->sampleRate / - outFormat->sampleRate; + while( wr_dat < nlen) { + rd_dat = wr_dat * inFormat->sampleRate / + outFormat->sampleRate; - lsample = in[ rd_dat++ ]; + lsample = in[ rd_dat++ ]; - out[ wr_dat++ ] = lsample; - } + out[ wr_dat++ ] = lsample; + } break; case 2: - while( wr_dat < nlen) { - rd_dat = wr_dat * inFormat->sampleRate / - outFormat->sampleRate; - rd_dat &= ~1; + while( wr_dat < nlen) { + rd_dat = wr_dat * inFormat->sampleRate / + outFormat->sampleRate; + rd_dat &= ~1; - lsample = in[ rd_dat++ ]; - rsample = in[ rd_dat++ ]; + lsample = in[ rd_dat++ ]; + rsample = in[ rd_dat++ ]; - out[ wr_dat++ ] = lsample; - out[ wr_dat++ ] = rsample; - } + out[ wr_dat++ ] = lsample; + out[ wr_dat++ ] = rsample; + } break; } } diff --git a/src/pcm_utils.h b/src/pcm_utils.h index a366c2a2d..32f5444aa 100644 --- a/src/pcm_utils.h +++ b/src/pcm_utils.h @@ -25,8 +25,6 @@ #include <stdlib.h> -void pcm_changeBufferEndianness(char * buffer, int bufferSize, int bits); - void pcm_volumeChange(char * buffer, int bufferSize, AudioFormat * format, int volume); |