[FFmpeg-cvslog] avformat: disable seeking on FIFOs/named pipes

Martin Sliwka git at videolan.org
Fri Jun 29 14:57:30 CEST 2012


ffmpeg | branch: master | Martin Sliwka <martin.sliwka at gmail.com> | Thu Jun 28 19:31:04 2012 +0200| [df531b0e1004cdc76e656465d84ede7cfd9e370a] | committer: Michael Niedermayer

avformat: disable seeking on FIFOs/named pipes

Patch is addition to my previous patch
(https://lists.ffmpeg.org/pipermail/ffmpeg-cvslog/2012-June/051590.html)
and disables seeking on FIFOs/named pipes by setting
URLContext::is_streamed (same as pipe: protocol does for stdin/stdout pipes)

Fixes Ticket986

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=df531b0e1004cdc76e656465d84ede7cfd9e370a
---

 libavformat/file.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/file.c b/libavformat/file.c
index 0c566c9..35c36a5 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -72,6 +72,7 @@ static int file_open(URLContext *h, const char *filename, int flags)
 {
     int access;
     int fd;
+    struct stat st;
 
     av_strstart(filename, "file:", &filename);
 
@@ -89,6 +90,9 @@ static int file_open(URLContext *h, const char *filename, int flags)
     if (fd == -1)
         return AVERROR(errno);
     h->priv_data = (void *) (intptr_t) fd;
+
+    h->is_streamed = (0==fstat(fd, &st) && S_ISFIFO(st.st_mode)) ? 1 : 0;
+
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list