diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2010-03-13 12:28:45 +0100 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2010-03-16 20:28:55 +0100 |
commit | b17fed7cf3d1ee7e0fef5de51e1d1cbacc21a06b (patch) | |
tree | 6ba30d4b6ff4ccbb849ebd1476ae049512272b91 /src | |
parent | 97d9c978334236f9ba190da342eb11f645ccde03 (diff) | |
download | pianobar-windows-b17fed7cf3d1ee7e0fef5de51e1d1cbacc21a06b.tar.gz pianobar-windows-b17fed7cf3d1ee7e0fef5de51e1d1cbacc21a06b.tar.bz2 pianobar-windows-b17fed7cf3d1ee7e0fef5de51e1d1cbacc21a06b.zip |
Replace player return value magic
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/player.c | 8 | ||||
-rw-r--r-- | src/player.h | 2 |
3 files changed, 6 insertions, 6 deletions
@@ -166,7 +166,7 @@ int main (int argc, char **argv) { void *threadRet; pthread_join (playerThread, &threadRet); /* don't continue playback if thread reports error */ - if (threadRet != NULL) { + if (threadRet != (void *) PLAYER_RET_OK) { curStation = NULL; } memset (&player, 0, sizeof (player)); diff --git a/src/player.c b/src/player.c index 2eb6e27..051220c 100644 --- a/src/player.c +++ b/src/player.c @@ -404,7 +404,7 @@ static WaitressCbReturn_t BarPlayerMp3Cb (void *ptr, size_t size, void *stream) void *BarPlayerThread (void *data) { struct audioPlayer *player = data; char extraHeaders[25]; - void *ret = NULL; + void *ret = PLAYER_RET_OK; #ifdef ENABLE_FAAD NeAACDecConfigurationPtr conf; #endif @@ -444,7 +444,7 @@ void *BarPlayerThread (void *data) { default: BarUiMsg (MSG_ERR, "Unsupported audio format!\n"); - return NULL; + return PLAYER_RET_OK; break; } @@ -480,7 +480,7 @@ void *BarPlayerThread (void *data) { break; } if (player->aoError) { - ret = (void *) 0x1; + ret = (void *) PLAYER_RET_ERR; } ao_close(player->audioOutDevice); WaitressFree (&player->waith); @@ -493,7 +493,5 @@ void *BarPlayerThread (void *data) { player->mode = PLAYER_FINISHED_PLAYBACK; - /* return NULL == everything's fine, everything else: hard error, stop - * playback */ return ret; } diff --git a/src/player.h b/src/player.h index 249fc6f..4ce0fbb 100644 --- a/src/player.h +++ b/src/player.h @@ -99,6 +99,8 @@ struct audioPlayer { pthread_mutex_t pauseMutex; }; +enum {PLAYER_RET_OK = 0, PLAYER_RET_ERR = 1}; + void *BarPlayerThread (void *data); #endif /* _PLAYER_H */ |