diff tcp.c @ 2351:b9a881c0967e libavformat

Add initialization and cleanup functions for Winsock
author ramiro
date Thu, 09 Aug 2007 23:39:05 +0000
parents 96bab3153939
children 13b65f62e3a6
line wrap: on
line diff
--- a/tcp.c	Thu Aug 09 23:29:58 2007 +0000
+++ b/tcp.c	Thu Aug 09 23:39:05 2007 +0000
@@ -53,6 +53,9 @@
     if (port <= 0 || port >= 65536)
         goto fail;
 
+    if(!ff_network_init())
+        return AVERROR(EIO);
+
     dest_addr.sin_family = AF_INET;
     dest_addr.sin_port = htons(port);
     if (resolve_host(&dest_addr.sin_addr, hostname) < 0)
@@ -174,6 +177,7 @@
 {
     TCPContext *s = h->priv_data;
     closesocket(s->fd);
+    ff_network_close();
     av_free(s);
     return 0;
 }