From 7d2fa5b1bcce7351b81b2d0d927e61035c2224d9 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Wed, 11 Nov 2009 19:50:04 +0100 Subject: Print message and stop playback when hitting libao error Thanks to jpfuentes2@github --- src/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main.c') 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)); } -- cgit v1.2.3