summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2013-04-17 15:31:54 +0200
committerLars-Dominik Braun <lars@6xq.net>2013-04-17 15:31:54 +0200
commit801d76fe006a64d07db7f5fc58222abe9af01f97 (patch)
tree2076f3ed9d0215b5b444d0f1ba9a924ffe6868f5 /src
parentc519d41a5afbb8e2adf98bd3d87c44a202293621 (diff)
downloadpianobar-windows-801d76fe006a64d07db7f5fc58222abe9af01f97.tar.gz
pianobar-windows-801d76fe006a64d07db7f5fc58222abe9af01f97.tar.bz2
pianobar-windows-801d76fe006a64d07db7f5fc58222abe9af01f97.zip
Fix player state for unsupported audio file formats
Player thread now sets its status correctly. Closes #360.
Diffstat (limited to 'src')
-rw-r--r--src/player.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/player.c b/src/player.c
index afd6eb4..16c94dc 100644
--- a/src/player.c
+++ b/src/player.c
@@ -488,9 +488,9 @@ void *BarPlayerThread (void *data) {
#endif /* ENABLE_MAD */
default:
- /* FIXME: leaks memory */
BarUiMsg (player->settings, MSG_ERR, "Unsupported audio format!\n");
- return PLAYER_RET_OK;
+ ret = (void *) PLAYER_RET_ERR;
+ goto cleanup;
break;
}
@@ -522,7 +522,8 @@ void *BarPlayerThread (void *data) {
#endif /* ENABLE_MAD */
default:
- /* this should never happen: thread is aborted above */
+ /* this should never happen */
+ assert (0);
break;
}
@@ -538,7 +539,8 @@ void *BarPlayerThread (void *data) {
ret = (void *) PLAYER_RET_ERR;
}
- ao_close(player->audioOutDevice);
+cleanup:
+ ao_close (player->audioOutDevice);
WaitressFree (&player->waith);
free (player->buffer);