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:
+8
-3
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user