diff --git a/libavformat/network.c b/libavformat/network.c index 8cc5aad6a9..47ade8cb62 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; }