aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-29 20:40:27 +0100
committerMax Kellermann <max@duempel.org>2008-10-29 20:40:27 +0100
commit58c5bee9f0bcb46da7d113b66a4e1e2d7add9837 (patch)
tree4517d2156aa3643247e7f2fc886af86d3dfd8791 /src/player_thread.c
parent03390d8be1cb8983778faf6eedb9bcfd26a6dbce (diff)
downloadmpd-58c5bee9f0bcb46da7d113b66a4e1e2d7add9837.tar.gz
mpd-58c5bee9f0bcb46da7d113b66a4e1e2d7add9837.tar.xz
mpd-58c5bee9f0bcb46da7d113b66a4e1e2d7add9837.zip
output: use bool for return values and flags
Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
Diffstat (limited to '')
-rw-r--r--src/player_thread.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index 35796d95d..0275b680a 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -156,7 +156,7 @@ static void processDecodeInput(struct player *player)
audio_output_pause_all();
pc.state = PLAYER_STATE_PAUSE;
} else {
- if (openAudioDevice(NULL) >= 0) {
+ if (openAudioDevice(NULL)) {
pc.state = PLAYER_STATE_PLAY;
} else {
char tmp[MPD_PATH_MAX];
@@ -215,8 +215,7 @@ static int playChunk(ob_chunk * chunk,
pcm_volume(chunk->data, chunk->chunkSize,
format, pc.softwareVolume);
- if (playAudio(chunk->data,
- chunk->chunkSize) < 0)
+ if (!playAudio(chunk->data, chunk->chunkSize))
return -1;
pc.totalPlayTime += sizeToTime * chunk->chunkSize;
@@ -288,7 +287,7 @@ static void do_play(void)
else if (!decoder_is_starting()) {
/* the decoder is ready and ok */
player.decoder_starting = false;
- if(openAudioDevice(&(ob.audioFormat))<0) {
+ if (!openAudioDevice(&ob.audioFormat)) {
char tmp[MPD_PATH_MAX];
assert(dc.next_song == NULL || dc.next_song->url != NULL);
pc.errored_song = dc.next_song;
@@ -439,7 +438,7 @@ static void do_play(void)
unsigned num_frames = CHUNK_SIZE / frame_size;
/*DEBUG("waiting for decoded audio, play silence\n");*/
- if (playAudio(silence, num_frames * frame_size) < 0)
+ if (!playAudio(silence, num_frames * frame_size))
break;
}
}