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
This commit is contained in:
Warren Dukes
2004-05-21 22:31:07 +00:00
parent aea1ae9b9e
commit 547e358796
11 changed files with 47 additions and 34 deletions
+8 -3
View File
@@ -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;