aboutsummaryrefslogtreecommitdiffstats
path: root/src/decode.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-04-01 03:48:51 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-04-01 03:48:51 +0000
commit3ab984176452000cc845adfb4afc8808a404a3c6 (patch)
treee5445ca386114bae6100788b9ace544ae48409f9 /src/decode.c
parent917af619da81e88fe3b10b54171935e093fb8821 (diff)
downloadmpd-3ab984176452000cc845adfb4afc8808a404a3c6.tar.gz
mpd-3ab984176452000cc845adfb4afc8808a404a3c6.tar.xz
mpd-3ab984176452000cc845adfb4afc8808a404a3c6.zip
use our own portable version of usleep using select()
git-svn-id: https://svn.musicpd.org/mpd/trunk@578 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/decode.c')
-rw-r--r--src/decode.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/decode.c b/src/decode.c
index 2f557f932..a849b738d 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -79,7 +79,7 @@ void stopDecode(DecoderControl * dc) {
(dc->start || dc->state==DECODE_STATE_DECODE))
{
dc->stop = 1;
- while(decode_pid && *decode_pid>0 && dc->stop) usleep(1000);
+ while(decode_pid && *decode_pid>0 && dc->stop) my_usleep(1000);
}
}
@@ -112,7 +112,7 @@ int calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af) {
int waitOnDecode(PlayerControl * pc, AudioFormat * af, DecoderControl * dc,
Buffer * cb)
{
- while(decode_pid && *decode_pid>0 && dc->start) usleep(1000);
+ while(decode_pid && *decode_pid>0 && dc->start) my_usleep(1000);
if(dc->start || dc->error!=DECODE_ERROR_NOERROR) {
strncpy(pc->erroredFile,pc->file,MAXPATHLEN);
@@ -164,7 +164,7 @@ void decodeSeek(PlayerControl * pc, AudioFormat * af, DecoderControl * dc,
dc->seekError = 0;
dc->seek = 1;
pc->bitRate = 0;
- while(*decode_pid>0 && dc->seek) usleep(1000);
+ while(*decode_pid>0 && dc->seek) my_usleep(1000);
if(!dc->seekError) pc->elapsedTime = dc->seekWhere;
}
}
@@ -272,7 +272,7 @@ int decoderInit(PlayerControl * pc, Buffer * cb, AudioFormat *af,
dc->stop = 0;
}
else if(dc->seek) dc->start = 1;
- else usleep(10000);
+ else my_usleep(10000);
}
exit(0);
@@ -339,7 +339,7 @@ void decode() {
{
processDecodeInput();
if(quit) return;
- usleep(1000);
+ my_usleep(1000);
}
while(!quit) {
@@ -367,7 +367,7 @@ void decode() {
}
else doCrossFade = -1;
}
- if(pause) usleep(10000);
+ if(pause) my_usleep(10000);
else if((cb->begin!=cb->end || cb->wrap) &&
cb->begin!=cb->next)
{
@@ -461,7 +461,7 @@ void decode() {
quitDecode(pc,dc);
return;
}
- usleep(1000);
+ my_usleep(1000);
}
if(pc->queueState!=PLAYER_QUEUE_PLAY) {
quit = 1;
@@ -484,7 +484,7 @@ void decode() {
quit = 1;
break;
}
- else usleep(1000);
+ else my_usleep(1000);
}
pc->totalPlayTime+= pc->elapsedTime-pc->beginTime; \