ret = read(c->fd, buf, size);
if (ret == 0 && c->follow)
return AVERROR(EAGAIN);
+ if (ret == 0)
+ return AVERROR_EOF;
return (ret == -1) ? AVERROR(errno) : ret;
}
h->is_streamed = !fstat(fd, &st) && S_ISFIFO(st.st_mode);
+ /* Buffer writes more than the default 32k to improve throughput especially
+ * with networked file systems */
+ if (!h->is_streamed && flags & AVIO_FLAG_WRITE)
+ h->min_packet_size = h->max_packet_size = 262144;
+
return 0;
}