HACK avio: add a flag to skip the fstat on file opening for performance reasons
This commit is contained in:
parent
39f9a2d1c9
commit
f40271004e
@ -643,6 +643,8 @@ int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
|
||||
*/
|
||||
#define AVIO_FLAG_DIRECT 0x8000
|
||||
|
||||
#define AVIO_FLAG_AVOID_FSTAT 0x80000000
|
||||
|
||||
/**
|
||||
* Create and initialize a AVIOContext for accessing the
|
||||
* resource indicated by url.
|
||||
|
@ -306,7 +306,7 @@ static int file_open(URLContext *h, const char *filename, int flags)
|
||||
return AVERROR(errno);
|
||||
c->fd = fd;
|
||||
|
||||
h->is_streamed = !fstat(fd, &st) && S_ISFIFO(st.st_mode);
|
||||
h->is_streamed = !(flags & AVIO_FLAG_AVOID_FSTAT) && !fstat(fd, &st) && S_ISFIFO(st.st_mode);
|
||||
|
||||
/* Buffer writes more than the default 32k to improve throughput especially
|
||||
* with networked file systems */
|
||||
|
Loading…
Reference in New Issue
Block a user