# HG changeset patch # User ramiro # Date 1187363669 0 # Node ID 1e827f59ddae5efaeb211898c0bffd4753156970 # Parent be66ba5bc96dcc72552c2e60ea4d77d391261b32 Allow pipe: URL to take fd number as input Patch by Vincent Fourmond [vincent dot fourmond at 9online dot fr] diff -r be66ba5bc96d -r 1e827f59ddae file.c --- a/file.c Fri Aug 17 15:12:30 2007 +0000 +++ b/file.c Fri Aug 17 15:14:29 2007 +0000 @@ -23,6 +23,7 @@ #include #include #include +#include /* standard file protocol */ @@ -90,12 +91,17 @@ static int pipe_open(URLContext *h, const char *filename, int flags) { int fd; + const char * final; + av_strstart(filename, "pipe:", &filename); + fd = strtol(filename, &final, 10); + if((filename == final) || *final ) {/* No digits found, or something like 10ab */ if (flags & URL_WRONLY) { fd = 1; } else { fd = 0; } + } #ifdef O_BINARY setmode(fd, O_BINARY); #endif