aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/udp.c
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2007-08-09 23:39:05 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2007-08-09 23:39:05 +0000
commit1642cb6b2e27437abd2bd9ee9a570446382cb26e (patch)
tree85e43ce900545f91dae4fd52a527aade260f8df1 /libavformat/udp.c
parent7c04134fa166e86f5c6cbe980e00f11e6871f0d1 (diff)
downloadffmpeg-1642cb6b2e27437abd2bd9ee9a570446382cb26e.tar.gz
Add initialization and cleanup functions for Winsock
Originally committed as revision 10040 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/udp.c')
-rw-r--r--libavformat/udp.c4
1 files changed, 4 insertions, 0 deletions
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;
}