[SCM] libav/experimental: Allow pipe: URL to take fd number as input Patch by Vincent Fourmond [vincent dot fourmond at 9online dot fr]

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:05:38 UTC 2013


The following commit has been merged in the experimental branch:
commit 9e33b10fd784aaefae92253779c4e8a6c5efa547
Author: Vincent Fourmond <vincent.fourmond at 9online.fr>
Date:   Fri Aug 17 15:14:29 2007 +0000

    Allow pipe: URL to take fd number as input
    Patch by Vincent Fourmond [vincent dot fourmond at 9online dot fr]
    
    Originally committed as revision 10134 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/file.c b/libavformat/file.c
index 48e7803..c0134d1 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -23,6 +23,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <sys/time.h>
+#include <stdlib.h>
 
 
 /* standard file protocol */
@@ -90,12 +91,17 @@ URLProtocol file_protocol = {
 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

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list