X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=libhb%2Fports.c;h=120038618bbd2197c43723285554e8085cde2445;hb=033e32de9c380f54c7d1362a3979da205ebc3a29;hp=6368bcba49d420208718f3fe9e1852cbbea365fd;hpb=3d055d99a614461665c909a1e9012c61a465d163;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/libhb/ports.c b/libhb/ports.c index 6368bcba..12003861 100644 --- a/libhb/ports.c +++ b/libhb/ports.c @@ -644,6 +644,23 @@ hb_net_t * hb_net_open( char * address, int port ) struct sockaddr_in sock; struct hostent * host; +#ifdef SYS_MINGW + WSADATA wsaData; + int iResult, winsock_init = 0; + + // Initialize Winsock + if (!winsock_init) + { + iResult = WSAStartup(MAKEWORD(2, 2), &wsaData); + if (iResult != 0) + { + hb_log("WSAStartup failed: %d", iResult); + return NULL; + } + winsock_init = 1; + } +#endif + /* TODO: find out why this doesn't work on Win32 */ if( !( host = gethostbyname( address ) ) ) {