[FFmpeg-devel] [PATCH] network: prevent SIGPIPE on OSX

wm4 nfxjfg at googlemail.com
Sat May 30 20:50:43 CEST 2015


OSX does not know MSG_NOSIGNAL, and provides its own non-standard
mechanism instead. I guess Apple hates standards.
---
 libavformat/network.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/network.c b/libavformat/network.c
index 8cc5aad..47ade8c 100644
--- a/libavformat/network.c
+++ b/libavformat/network.c
@@ -180,6 +180,10 @@ int ff_socket(int af, int type, int proto)
         }
 #endif
     }
+#ifdef SO_NOSIGPIPE
+    if (fd != -1)
+        setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &(int){1}, sizeof(int));
+#endif
     return fd;
 }
 
-- 
2.1.4



More information about the ffmpeg-devel mailing list