[MPlayer-cvslog] CVS: main/libmpdemux stream.c,1.73,1.74

Sascha Sommer CVS syncmail at mplayerhq.hu
Fri May 13 00:07:13 CEST 2005


CVS change done by Sascha Sommer CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv27407/libmpdemux

Modified Files:
	stream.c 
Log Message:
fix segfaults caused by socket and file descriptor mismatches on windows

Index: stream.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- stream.c	27 Feb 2005 04:25:12 -0000	1.73
+++ stream.c	12 May 2005 22:07:11 -0000	1.74
@@ -444,7 +444,14 @@
   default:
     if(s->close) s->close(s);
   }
-  if(s->fd>0) closesocket(s->fd);
+  if(s->fd>0){
+    /* on unix we define closesocket to close
+       on windows however we have to distinguish between
+       network socket and file */
+    if(s->url && strstr(s->url,"://"))
+      closesocket(s->fd);
+    else close(s->fd);
+  }
 #ifdef HAVE_WINSOCK2
   mp_msg(MSGT_STREAM,MSGL_V,"WINSOCK2 uninit\n");
   WSACleanup(); // there might be a better place for this (-> later)




More information about the MPlayer-cvslog mailing list