diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-11-02 02:44:11 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-11-02 02:44:11 +0000 |
commit | aab6515c52aebd5532ba6d5326196395928d39ba (patch) | |
tree | e1a6f6a49d3d43404906e792ca9fabf81557db3f /src/decode.c | |
parent | 9ef68105cb3fde47c15224054e1c6755c333018f (diff) | |
download | mpd-aab6515c52aebd5532ba6d5326196395928d39ba.tar.gz mpd-aab6515c52aebd5532ba6d5326196395928d39ba.tar.xz mpd-aab6515c52aebd5532ba6d5326196395928d39ba.zip |
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
Diffstat (limited to 'src/decode.c')
-rw-r--r-- | src/decode.c | 12 |
1 files changed, 8 insertions, 4 deletions
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); |