diff options
Diffstat (limited to '')
-rw-r--r-- | src/outputBuffer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/outputBuffer.c b/src/outputBuffer.c index 9d77caf3a..daf03d4b0 100644 --- a/src/outputBuffer.c +++ b/src/outputBuffer.c @@ -204,8 +204,7 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream, size_t dataInLen, float data_time, mpd_uint16 bitRate, ReplayGainInfo * replayGainInfo) { - mpd_uint16 dataToSend; - mpd_uint16 chunkLeft; + size_t dataToSend; char *data; size_t datalen; static char *convBuffer; @@ -244,8 +243,9 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream, chunk = outputBufferGetChunk(cb, chunk_index); - chunkLeft = sizeof(chunk->data) - chunk->chunkSize; - dataToSend = datalen > chunkLeft ? chunkLeft : datalen; + dataToSend = sizeof(chunk->data) - chunk->chunkSize; + if (dataToSend > datalen) + dataToSend = datalen; memcpy(chunk->data + chunk->chunkSize, data, dataToSend); chunk->chunkSize += dataToSend; |