diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2007-08-09 23:39:05 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2007-08-09 23:39:05 +0000 |
commit | 1642cb6b2e27437abd2bd9ee9a570446382cb26e (patch) | |
tree | 85e43ce900545f91dae4fd52a527aade260f8df1 /libavformat/network.h | |
parent | 7c04134fa166e86f5c6cbe980e00f11e6871f0d1 (diff) | |
download | ffmpeg-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/network.h')
-rw-r--r-- | libavformat/network.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavformat/network.h b/libavformat/network.h index 37606ee98d..4c9a3a07c0 100644 --- a/libavformat/network.h +++ b/libavformat/network.h @@ -44,6 +44,23 @@ int ff_socket_nonblock(int socket, int enable); +static inline int ff_network_init(void) +{ +#ifdef HAVE_WINSOCK2_H + WSADATA wsaData; + if (WSAStartup(MAKEWORD(1,1), &wsaData)) + return 0; +#endif + return 1; +} + +static inline void ff_network_close(void) +{ +#ifdef HAVE_WINSOCK2_H + WSACleanup(); +#endif +} + #if !defined(HAVE_INET_ATON) /* in os_support.c */ int inet_aton (const char * str, struct in_addr * add); |