Skip to content
Snippets Groups Projects
Commit df531b0e authored by Martin Sliwka's avatar Martin Sliwka Committed by Michael Niedermayer
Browse files

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: default avatarMichael Niedermayer <michaelni@gmx.at>
parent 6851130f
No related branches found
No related tags found
No related merge requests found
...@@ -72,6 +72,7 @@ static int file_open(URLContext *h, const char *filename, int flags) ...@@ -72,6 +72,7 @@ static int file_open(URLContext *h, const char *filename, int flags)
{ {
int access; int access;
int fd; int fd;
struct stat st;
av_strstart(filename, "file:", &filename); av_strstart(filename, "file:", &filename);
...@@ -89,6 +90,9 @@ static int file_open(URLContext *h, const char *filename, int flags) ...@@ -89,6 +90,9 @@ static int file_open(URLContext *h, const char *filename, int flags)
if (fd == -1) if (fd == -1)
return AVERROR(errno); return AVERROR(errno);
h->priv_data = (void *) (intptr_t) fd; h->priv_data = (void *) (intptr_t) fd;
h->is_streamed = (0==fstat(fd, &st) && S_ISFIFO(st.st_mode)) ? 1 : 0;
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment