Commit be753fb5 authored by Warren Dukes's avatar Warren Dukes

make all sleeps at least 1 ms

git-svn-id: https://svn.musicpd.org/mpd/trunk@279 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent 2320970c
...@@ -78,7 +78,7 @@ void stopDecode(DecoderControl * dc) { ...@@ -78,7 +78,7 @@ void stopDecode(DecoderControl * dc) {
(dc->start || dc->state==DECODE_STATE_DECODE)) (dc->start || dc->state==DECODE_STATE_DECODE))
{ {
dc->stop = 1; dc->stop = 1;
while(decode_pid && *decode_pid>0 && dc->stop) usleep(10); while(decode_pid && *decode_pid>0 && dc->stop) usleep(1000);
} }
} }
...@@ -111,7 +111,7 @@ int calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af) { ...@@ -111,7 +111,7 @@ int calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af) {
int waitOnDecode(PlayerControl * pc, AudioFormat * af, DecoderControl * dc, int waitOnDecode(PlayerControl * pc, AudioFormat * af, DecoderControl * dc,
Buffer * cb) Buffer * cb)
{ {
while(decode_pid && *decode_pid>0 && dc->start) usleep(10); while(decode_pid && *decode_pid>0 && dc->start) usleep(1000);
if(dc->start || dc->error!=DECODE_ERROR_NOERROR) { if(dc->start || dc->error!=DECODE_ERROR_NOERROR) {
strncpy(pc->erroredFile,pc->file,MAXPATHLEN); strncpy(pc->erroredFile,pc->file,MAXPATHLEN);
...@@ -162,7 +162,7 @@ void decodeSeek(PlayerControl * pc, AudioFormat * af, DecoderControl * dc, ...@@ -162,7 +162,7 @@ void decodeSeek(PlayerControl * pc, AudioFormat * af, DecoderControl * dc,
dc->seek = 1; dc->seek = 1;
pc->elapsedTime = dc->seekWhere; pc->elapsedTime = dc->seekWhere;
pc->bitRate = 0; pc->bitRate = 0;
while(*decode_pid>0 && dc->seek) usleep(10); while(*decode_pid>0 && dc->seek) usleep(1000);
} }
} }
pc->seek = 0; pc->seek = 0;
...@@ -443,7 +443,7 @@ void decode() { ...@@ -443,7 +443,7 @@ void decode() {
quitDecode(pc,dc); quitDecode(pc,dc);
return; return;
} }
usleep(10); usleep(1000);
} }
if(pc->queueState!=PLAYER_QUEUE_PLAY) { if(pc->queueState!=PLAYER_QUEUE_PLAY) {
quit = 1; quit = 1;
......
...@@ -194,7 +194,7 @@ int playerPlay(FILE * fp, char * utf8file) { ...@@ -194,7 +194,7 @@ int playerPlay(FILE * fp, char * utf8file) {
return -1; return -1;
} }
while(player_pid>0 && pc->play) usleep(10); while(player_pid>0 && pc->play) usleep(1000);
return 0; return 0;
} }
...@@ -204,7 +204,7 @@ int playerStop(FILE * fp) { ...@@ -204,7 +204,7 @@ int playerStop(FILE * fp) {
if(player_pid>0 && pc->state!=PLAYER_STATE_STOP) { if(player_pid>0 && pc->state!=PLAYER_STATE_STOP) {
pc->stop = 1; pc->stop = 1;
while(player_pid>0 && pc->stop) usleep(10); while(player_pid>0 && pc->stop) usleep(1000);
} }
pc->queueState = PLAYER_QUEUE_BLANK; pc->queueState = PLAYER_QUEUE_BLANK;
...@@ -230,7 +230,7 @@ int playerPause(FILE * fp) { ...@@ -230,7 +230,7 @@ int playerPause(FILE * fp) {
if(player_pid>0 && pc->state!=PLAYER_STATE_STOP) { if(player_pid>0 && pc->state!=PLAYER_STATE_STOP) {
pc->pause = 1; pc->pause = 1;
while(player_pid>0 && pc->pause) usleep(10); while(player_pid>0 && pc->pause) usleep(1000);
} }
return 0; return 0;
...@@ -361,7 +361,7 @@ void playerQueueLock() { ...@@ -361,7 +361,7 @@ void playerQueueLock() {
if(player_pid>0 && pc->queueLockState==PLAYER_QUEUE_UNLOCKED) if(player_pid>0 && pc->queueLockState==PLAYER_QUEUE_UNLOCKED)
{ {
pc->lockQueue = 1; pc->lockQueue = 1;
while(player_pid>0 && pc->lockQueue) usleep(10); while(player_pid>0 && pc->lockQueue) usleep(1000);
} }
} }
...@@ -371,7 +371,7 @@ void playerQueueUnlock() { ...@@ -371,7 +371,7 @@ void playerQueueUnlock() {
if(player_pid>0 && pc->queueLockState==PLAYER_QUEUE_LOCKED) if(player_pid>0 && pc->queueLockState==PLAYER_QUEUE_LOCKED)
{ {
pc->unlockQueue = 1; pc->unlockQueue = 1;
while(player_pid>0 && pc->unlockQueue) usleep(10); while(player_pid>0 && pc->unlockQueue) usleep(1000);
} }
} }
...@@ -394,7 +394,7 @@ int playerSeek(FILE * fp, char * utf8file, float time) { ...@@ -394,7 +394,7 @@ int playerSeek(FILE * fp, char * utf8file, float time) {
if(pc->error==PLAYER_ERROR_NOERROR) { if(pc->error==PLAYER_ERROR_NOERROR) {
pc->seekWhere = time; pc->seekWhere = time;
pc->seek = 1; pc->seek = 1;
while(player_pid>0 && pc->seek) usleep(10); while(player_pid>0 && pc->seek) usleep(1000);
} }
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment