summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-25 15:03:35 +0200
committerLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-25 15:03:35 +0200
commit0988793eadd015775507b30cb53f751ab8aba80e (patch)
tree7aa84d972b47e383c35236b08c6cb979499cf331
parent1ae32fdac0c959896a76e5c9a065b208bc62a0a7 (diff)
downloadpianobar-0988793eadd015775507b30cb53f751ab8aba80e.tar.gz
pianobar-0988793eadd015775507b30cb53f751ab8aba80e.tar.bz2
pianobar-0988793eadd015775507b30cb53f751ab8aba80e.zip
client: Faster player thread abort
-rw-r--r--src/player.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/player.c b/src/player.c
index d0bc4cb..6861a9a 100644
--- a/src/player.c
+++ b/src/player.c
@@ -85,7 +85,7 @@ size_t BarPlayerCurlCb (void *ptr, size_t size, size_t nmemb, void *stream) {
(unsigned char *) player->buffer + player->bufferRead,
player->sampleSize[player->sampleSizeCurr]);
if (frameInfo.error != 0) {
- printf ("error: %s\n\n",
+ printf (PACKAGE ": Decoding error: %s\n\n",
NeAACDecGetErrorMessage (frameInfo.error));
break;
}
@@ -93,6 +93,11 @@ size_t BarPlayerCurlCb (void *ptr, size_t size, size_t nmemb, void *stream) {
frameInfo.samples*frameInfo.channels);
player->bufferRead += frameInfo.bytesconsumed;
player->sampleSizeCurr++;
+ /* going through this loop can take up to a few seconds =>
+ * allow earlier thread abort */
+ if (player->doQuit) {
+ return 0;
+ }
}
} else {
if (player->mode == FIND_ESDS) {