aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_utils.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-09-12 02:17:13 -0700
committerEric Wong <normalperson@yhbt.net>2008-09-12 02:17:13 -0700
commit12d4956528b7abd34aa5d827a2f088f6eb45df98 (patch)
tree83c070df37f8d03e562ea9ad0b9274e0d4082351 /src/pcm_utils.c
parent1b6315e8f6372e7abe1a3eb08b27b2f331aa2728 (diff)
parentcb0253d02dc1d51bc84c65d8c7362c8a18c116f2 (diff)
downloadmpd-12d4956528b7abd34aa5d827a2f088f6eb45df98.tar.gz
mpd-12d4956528b7abd34aa5d827a2f088f6eb45df98.tar.xz
mpd-12d4956528b7abd34aa5d827a2f088f6eb45df98.zip
Merge branch 'mk/client-merge'
* mk/client-merge: (49 commits) client: shorten names of the struct client variables client: simplified client_read() client: client_input_received() returns 0 client: check for COMMAND_RETURN_CLOSE client: renamed local variable "selret" to "ret" client: moved CLOSE/KILL check after client_process_line() client: don't check FD_ISSET(client->fd) on expired client client: removed assert(client->fd)>=0 fix -Wcast-qual -Wwrite-strings warnings playlist: return -1 after assert(0) command: concatenate strings at compile time audio: don't pass "fd" to {en,dis}ableAudioDevice() volume: don't pass "fd" to changeVolumeLevel() directory: printDirectoryInfo() does not call commandError() directory: don't pass fd to traverseAllIn() directory: don't pass fd to traverseAllIn() callbacks playlist: PlaylistInfo() does not call commandError() playlist: don't pass "fd" to storedPlaylist.c functions playlist: don't pass "fd" to playlist.c functions playlist: showPlaylist() and shufflePlaylist() cannot fail ...
Diffstat (limited to 'src/pcm_utils.c')
-rw-r--r--src/pcm_utils.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/pcm_utils.c b/src/pcm_utils.c
index f716c279d..90856fa1d 100644
--- a/src/pcm_utils.c
+++ b/src/pcm_utils.c
@@ -149,6 +149,7 @@ static int pcm_getSampleRateConverter(void)
const char *conf = getConfigParamValue(CONF_SAMPLERATE_CONVERTER);
long convalgo;
char *test;
+ const char *test2;
size_t len;
if (!conf) {
@@ -162,12 +163,12 @@ static int pcm_getSampleRateConverter(void)
len = strlen(conf);
for (convalgo = 0 ; ; convalgo++) {
- test = (char *)src_get_name(convalgo);
- if (!test) {
+ test2 = src_get_name(convalgo);
+ if (!test2) {
convalgo = SRC_SINC_FASTEST;
break;
}
- if (strncasecmp(test, conf, len) == 0)
+ if (strncasecmp(test2, conf, len) == 0)
goto out;
}
@@ -239,7 +240,7 @@ static size_t pcm_convertSampleRate(mpd_sint8 channels, mpd_uint32 inSampleRate,
data->data_out = xrealloc(data->data_out, dataOutSize);
}
- src_short_to_float_array((short *)inBuffer, data->data_in,
+ src_short_to_float_array((const short *)inBuffer, data->data_in,
data->input_frames * channels);
error = src_process(convState->state, data);
@@ -305,7 +306,7 @@ static char *pcm_convertChannels(mpd_sint8 channels, const char *inBuffer,
static char *buf;
static size_t len;
char *outBuffer = NULL;
- mpd_sint16 *in;
+ const mpd_sint16 *in;
mpd_sint16 *out;
int inSamples, i;
@@ -320,7 +321,7 @@ static char *pcm_convertChannels(mpd_sint8 channels, const char *inBuffer,
outBuffer = buf;
inSamples = inSize >> 1;
- in = (mpd_sint16 *)inBuffer;
+ in = (const mpd_sint16 *)inBuffer;
out = (mpd_sint16 *)outBuffer;
for (i = 0; i < inSamples; i++) {
*out++ = *in;
@@ -338,7 +339,7 @@ static char *pcm_convertChannels(mpd_sint8 channels, const char *inBuffer,
outBuffer = buf;
inSamples = inSize >> 2;
- in = (mpd_sint16 *)inBuffer;
+ in = (const mpd_sint16 *)inBuffer;
out = (mpd_sint16 *)outBuffer;
for (i = 0; i < inSamples; i++) {
*out = (*in++) / 2;
@@ -359,7 +360,7 @@ static const char *pcm_convertTo16bit(mpd_sint8 bits, const char *inBuffer,
static char *buf;
static size_t len;
char *outBuffer = NULL;
- mpd_sint8 *in;
+ const mpd_sint8 *in;
mpd_sint16 *out;
size_t i;
@@ -372,7 +373,7 @@ static const char *pcm_convertTo16bit(mpd_sint8 bits, const char *inBuffer,
}
outBuffer = buf;
- in = (mpd_sint8 *)inBuffer;
+ in = (const mpd_sint8 *)inBuffer;
out = (mpd_sint16 *)outBuffer;
for (i = 0; i < inSize; i++)
*out++ = (*in++) << 8;