From aab6515c52aebd5532ba6d5326196395928d39ba Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Tue, 2 Nov 2004 02:44:11 +0000 Subject: patches for 0.11.5 bug fix from the following revision changes: 1993 2000 2001 2026 2028 2038 2078 2116 2163 2164 2230 2236 2270 2337 2339 2420 2426 git-svn-id: https://svn.musicpd.org/mpd/branches/branch-0.11.4-fixes@2461 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/decode.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/decode.c') diff --git a/src/decode.c b/src/decode.c index 6034c141b..852767253 100644 --- a/src/decode.c +++ b/src/decode.c @@ -115,7 +115,7 @@ int calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af) { MAXPATHLEN); \ pc->erroredUrl[MAXPATHLEN] = '\0'; \ pc->error = PLAYER_ERROR_AUDIO; \ - ERROR("problems opeing audio device while playing \"%s\"", pc->utf8url); \ + ERROR("problems opening audio device while playing \"%s\"", pc->utf8url); \ quitDecode(pc,dc); \ return; \ } \ @@ -157,7 +157,6 @@ int waitOnDecode(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb, } pc->totalTime = pc->fileTime; - pc->elapsedTime = 0; pc->bitRate = 0; pc->sampleRate = 0; pc->bits = 0; @@ -228,7 +227,7 @@ int decodeSeek(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb, MAXPATHLEN); \ pc->erroredUrl[MAXPATHLEN] = '\0'; \ pc->error = PLAYER_ERROR_AUDIO; \ - ERROR("problems opeing audio device while playing \"%s\"", pc->utf8url); \ + ERROR("problems opening audio device while playing \"%s\"", pc->utf8url); \ quitDecode(pc,dc); \ return; \ } \ @@ -286,7 +285,11 @@ void decodeStart(PlayerControl * pc, OutputBuffer * cb, DecoderControl * dc) { dc->start = 0; while(!inputStreamAtEOF(&inStream) && bufferInputStream(&inStream) < 0 - && !dc->stop); + && !dc->stop) + { + /* sleep so we don't consume 100% of the cpu */ + my_usleep(1000); + } if(dc->stop) { dc->state = DECODE_STATE_STOP; @@ -461,6 +464,7 @@ void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb) { if(waitOnDecode(pc,dc,cb,&decodeWaitedOn)<0) return; + pc->elapsedTime = 0; pc->state = PLAYER_STATE_PLAY; pc->play = 0; kill(getppid(),SIGUSR1); -- cgit v1.2.3