[MPlayer-cvslog] r32086 - trunk/udp_sync.c

reimar subversion at mplayerhq.hu
Wed Sep 8 20:25:55 CEST 2010


Author: reimar
Date: Wed Sep  8 20:25:55 2010
New Revision: 32086

Log:
Use initializer to avoid leaving struct timeval half-uninitialized.

Modified:
   trunk/udp_sync.c

Modified: trunk/udp_sync.c
==============================================================================
--- trunk/udp_sync.c	Wed Sep  8 20:24:13 2010	(r32085)
+++ trunk/udp_sync.c	Wed Sep  8 20:25:55 2010	(r32086)
@@ -87,7 +87,7 @@ int get_udp(int blocking, float *master_
     static int done_init_yet = 0;
     static int sockfd;
     if (!done_init_yet) {
-        struct timeval tv;
+        struct timeval tv = { .tv_sec = 30 };
         struct sockaddr_in servaddr = { 0 };
 
         done_init_yet = 1;
@@ -99,7 +99,6 @@ int get_udp(int blocking, float *master_
         servaddr.sin_port        = htons(udp_port);
         bind(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr));
 
-        tv.tv_sec = 30;
         setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
 
     }


More information about the MPlayer-cvslog mailing list