Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2013-04-28 14:19:31 +0400
committerHendrik Leppkes <h.leppkes@gmail.com>2017-08-04 20:12:11 +0300
commitf7e1373ac807a9b007e7598b292416751ac6c879 (patch)
tree3c1b25ac469cd5e4749f1d201d870016c30f2d7f
parent89a68acfd78a9488b432efeaf906fbf8c8d85399 (diff)
HACK avio: add a flag to skip the fstat on file opening for performance reasons
-rw-r--r--libavformat/avio.h2
-rw-r--r--libavformat/file.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h
index f14b003ba5..33a94508aa 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -669,6 +669,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.
diff --git a/libavformat/file.c b/libavformat/file.c
index 1d321c4205..563918f34d 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -227,7 +227,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 */