1
0
Fork 0

HACK avio: add a flag to skip the fstat on file opening for performance reasons

This commit is contained in:
Hendrik Leppkes 2013-04-28 12:19:31 +02:00
parent 6d225eb160
commit 821abdd77c
Signed by: hendrik
GPG Key ID: 846079A4B0A7C1B5
2 changed files with 3 additions and 1 deletions

View File

@ -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.

View File

@ -333,7 +333,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 */