mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 20:13:36 +00:00
fwrite() more aggressively in HttpDataStream so data is available
immediately to readers.
This commit is contained in:
parent
6d460fe27a
commit
f2724261f1
@ -464,10 +464,11 @@ size_t HttpDataStream::CurlWriteCallback(char *ptr, size_t size, size_t nmemb, v
|
||||
|
||||
size_t total = size * nmemb;
|
||||
size_t result = fwrite(ptr, size, nmemb, stream->writeFile);
|
||||
fflush(stream->writeFile); /* normally we wouldn't want to do this, but it ensures
|
||||
data written is available immediately to any simultaneous readers */
|
||||
stream->written += result;
|
||||
|
||||
if (stream->written >= stream->chunkSizeBytes) {
|
||||
fflush(stream->writeFile);
|
||||
stream->reader->Add(stream->written);
|
||||
stream->written = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user