Commit abda2f59 authored by ogg.k.ogg.k's avatar ogg.k.ogg.k Committed by conrad

use read(2) instead of fread(3) in order to avoid stalling when the data comes...

use read(2) instead of fread(3) in order to avoid stalling when the data comes in slowly (eg, live stream at very low bitrate).
parent 8ac44ca8
......@@ -71,7 +71,7 @@ my_io_read (void * user_handle, void * buf, size_t n)
{
FILE * f = (FILE *)user_handle;
return fread (buf, 1, n, f);
return read (fileno(f), buf, n);
}
static int
......
......@@ -55,7 +55,7 @@ oggz_io_read (OGGZ * oggz, void * buf, size_t n)
size_t bytes;
if (oggz->file != NULL) {
if ((bytes = fread (buf, 1, n, oggz->file)) == 0) {
if ((bytes = read (fileno(oggz->file), buf, n)) == 0) {
if (ferror (oggz->file)) {
return (size_t) OGGZ_ERR_SYSTEM;
}
......
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