Commit ac0ac9d4 authored by Max Kellermann's avatar Max Kellermann Committed by Eric Wong

flush after loop in sendDataToOutputBuffer()

Since tailChunk() automatically flushes full buffers, we do not have to check this in every iteration of sendDataToOutputBuffer(). git-svn-id: https://svn.musicpd.org/mpd/trunk@7343 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent e4746b82
......@@ -209,6 +209,7 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream,
size_t datalen;
static char *convBuffer;
static size_t convBufferLen;
OutputBufferChunk *chunk = NULL;
if (cmpAudioFormat(&(cb->audioFormat), &(dc->audioFormat)) == 0) {
data = dataIn;
......@@ -234,7 +235,6 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream,
normalizeData(data, datalen, &cb->audioFormat);
while (datalen) {
OutputBufferChunk *chunk;
int chunk_index = tailChunk(cb, inStream,
dc, seekable,
data_time, bitRate);
......@@ -251,12 +251,11 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream,
chunk->chunkSize += dataToSend;
datalen -= dataToSend;
data += dataToSend;
if (chunk->chunkSize == sizeof(chunk->data)) {
flushOutputBuffer(cb);
}
}
if (chunk != NULL && chunk->chunkSize == sizeof(chunk->data))
flushOutputBuffer(cb);
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment