diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-05-21 22:31:07 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-05-21 22:31:07 +0000 |
commit | 547e358796b9d82041b94f18f9ddcb972b8f1e7e (patch) | |
tree | a9a49eb760ebf7d3f77f2dffac74902996574b95 /src/outputBuffer.c | |
parent | aea1ae9b9ec6d2e8d00d11ee59047a8e71afe123 (diff) |
do input buffering in while sleeping loop of sending stuff to output buffer
git-svn-id: https://svn.musicpd.org/mpd/trunk@1125 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/outputBuffer.c')
-rw-r--r-- | src/outputBuffer.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/outputBuffer.c b/src/outputBuffer.c index 2323ea97b..f1ea86925 100644 --- a/src/outputBuffer.c +++ b/src/outputBuffer.c @@ -43,8 +43,9 @@ void flushOutputBuffer(OutputBuffer * cb) { } } -int sendDataToOutputBuffer(OutputBuffer * cb, DecoderControl * dc, - char * dataIn, long dataInLen, float time, mpd_uint16 bitRate) +int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream, + DecoderControl * dc, char * dataIn, long dataInLen, float time, + mpd_uint16 bitRate) { mpd_uint16 dataToSend; mpd_uint16 chunkLeft; @@ -75,7 +76,11 @@ int sendDataToOutputBuffer(OutputBuffer * cb, DecoderControl * dc, if(currentChunk != cb->end) { while(cb->begin==cb->end && cb->wrap && !dc->stop) { - my_usleep(10000); + if(!inStream || + bufferInputStream(inStream) <= 0) + { + my_usleep(10000); + } } if(dc->stop) return OUTPUT_BUFFER_DC_STOP; |