From 1642cb6b2e27437abd2bd9ee9a570446382cb26e Mon Sep 17 00:00:00 2001 From: Ramiro Polla Date: Thu, 9 Aug 2007 23:39:05 +0000 Subject: Add initialization and cleanup functions for Winsock Originally committed as revision 10040 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/udp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libavformat/udp.c') diff --git a/libavformat/udp.c b/libavformat/udp.c index 0c42945eb1..edbf543ba9 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -321,6 +321,9 @@ static int udp_open(URLContext *h, const char *uri, int flags) udp_set_remote_url(h, uri); } + if(!ff_network_init()) + return AVERROR(EIO); + #ifndef CONFIG_IPV6 udp_fd = socket(AF_INET, SOCK_DGRAM, 0); if (udp_fd < 0) @@ -472,6 +475,7 @@ static int udp_close(URLContext *h) udp_ipv6_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr); #endif closesocket(s->udp_fd); + ff_network_close(); av_free(s); return 0; } -- cgit v1.2.3