aboutsummaryrefslogtreecommitdiffstats
path: root/src/outputBuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/outputBuffer.c')
-rw-r--r--src/outputBuffer.c11
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;