add winsock support
[melted_gui] / src / player.c
index 206191b..018661f 100644 (file)
 #include <mvcp/mvcp.h>
 #include <mvcp/mvcp_remote.h>
 
+#if defined(__MINGW32__)
+#include <windows.h>
+#endif
+
 #include "player.h"
 #include "ui.h"
 #include "timecode.h"
@@ -145,12 +149,17 @@ static void* player_thread_proc(void* data)
     /* endless reconnect loop */
     for(; !player->app->f_exit;)
     {
+        r = mvcp_connect(handle->command);
         /* connect */
-        if(mvcp_connect(handle->command) != mvcp_ok)
+        if(mvcp_ok != r)
         {
-            g_warning("player_thread_proc: failed to connect to server %s:%d (player=%d, unit=%d)\n",
-                player->app->players.host, player->app->players.port, player->idx, player->unit);
+            g_warning("player_thread_proc: failed to connect to server %s:%d (player=%d, unit=%d), r=%d\n",
+                player->app->players.host, player->app->players.port, player->idx, player->unit, r);
+#if defined(__MINGW32__)
+            Sleep(1000);
+#else
             sleep(1);
+#endif
             continue;
         };