aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutputs
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/audioOutputs
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/audioOutputs')
-rw-r--r--src/audioOutputs/audioOutput_jack.c17
-rw-r--r--src/audioOutputs/audioOutput_shout.c4
2 files changed, 11 insertions, 10 deletions
diff --git a/src/audioOutputs/audioOutput_jack.c b/src/audioOutputs/audioOutput_jack.c
index 8818bb739..77ee077a4 100644
--- a/src/audioOutputs/audioOutput_jack.c
+++ b/src/audioOutputs/audioOutput_jack.c
@@ -31,8 +31,8 @@ static const size_t sample_size = sizeof(jack_default_audio_sample_t);
typedef struct _JackData {
/* configuration */
- char *name;
- char *output_ports[2];
+ const char *name;
+ const char *output_ports[2];
int ringbuf_sz;
/* locks */
@@ -52,6 +52,7 @@ typedef struct _JackData {
static JackData *newJackData(void)
{
JackData *ret;
+
ret = xcalloc(sizeof(JackData), 1);
ret->name = "mpd";
@@ -97,12 +98,12 @@ static void freeJackData(AudioOutput *audioOutput)
freeJackClient(jd);
if (strcmp(jd->name, "mpd") != 0)
- free(jd->name);
+ free(deconst_ptr(jd->name));
for ( i = ARRAY_SIZE(jd->output_ports); --i >= 0; ) {
if (!jd->output_ports[i])
continue;
- free(jd->output_ports[i]);
+ free(deconst_ptr(jd->output_ports[i]));
}
free(jd);
@@ -267,7 +268,7 @@ static int jack_testDefault(void)
static int connect_jack(AudioOutput *audioOutput)
{
JackData *jd = audioOutput->data;
- char **jports;
+ const char **jports;
char *port_name;
if ( (jd->client = jack_client_new(jd->name)) == NULL ) {
@@ -304,9 +305,9 @@ static int connect_jack(AudioOutput *audioOutput)
/* hay que buscar que hay */
if ( !jd->output_ports[1]
- && (jports = (char **)jack_get_ports(jd->client, NULL, NULL,
- JackPortIsPhysical|
- JackPortIsInput)) ) {
+ && (jports = jack_get_ports(jd->client, NULL, NULL,
+ JackPortIsPhysical|
+ JackPortIsInput)) ) {
jd->output_ports[0] = jports[0];
jd->output_ports[1] = jports[1] ? jports[1] : jports[0];
DEBUG("output_ports: %s %s\n",
diff --git a/src/audioOutputs/audioOutput_shout.c b/src/audioOutputs/audioOutput_shout.c
index b65a8253f..2ee942809 100644
--- a/src/audioOutputs/audioOutput_shout.c
+++ b/src/audioOutputs/audioOutput_shout.c
@@ -636,8 +636,8 @@ static int myShout_play(AudioOutput * audioOutput,
for (i = 0; i < samples; i++) {
for (j = 0; j < sd->audioFormat->channels; j++) {
- vorbbuf[j][i] =
- (*((mpd_sint16 *)deconst_ptr(playChunk))) / 32768.0;
+ vorbbuf[j][i] = (*((const mpd_sint16 *) playChunk))
+ / 32768.0;
playChunk += bytes;
}
}