summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-11-11 19:50:04 +0100
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-11-11 19:50:04 +0100
commit7d2fa5b1bcce7351b81b2d0d927e61035c2224d9 (patch)
tree7b41294b368875b88c93896ca817f321f92f1158 /src/main.c
parentb7986539c350f5de1077dd27eeffaa4c11a476f7 (diff)
downloadpianobar-7d2fa5b1bcce7351b81b2d0d927e61035c2224d9.tar.gz
pianobar-7d2fa5b1bcce7351b81b2d0d927e61035c2224d9.tar.bz2
pianobar-7d2fa5b1bcce7351b81b2d0d927e61035c2224d9.zip
Print message and stop playback when hitting libao error
Thanks to jpfuentes2@github
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 4549118..08eac48 100644
--- a/src/main.c
+++ b/src/main.c
@@ -189,7 +189,12 @@ int main (int argc, char **argv) {
WardrobeSongDestroy (&scrobbleSong);
/* FIXME: pthread_join blocks everything if network connection
* is hung up e.g. */
- pthread_join (playerThread, NULL);
+ void *threadRet;
+ pthread_join (playerThread, &threadRet);
+ /* don't continue playback if thread reports error */
+ if (threadRet != NULL) {
+ curStation = NULL;
+ }
memset (&player, 0, sizeof (player));
}