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

Rich Felker dalias at aerifal.cx
Fri May 13 02:52:14 CEST 2005


On Fri, May 13, 2005 at 12:07:13AM +0200, Sascha Sommer CVS wrote:
> 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);
> +  }

This is incorrect, highly! what if i'm using a file:// url? Or a file
with :// in its pathname?? (stupid but..)
Instead you should add a new field to the stream that tells if it's a
socket, or find some hack to work around the problem on windows..

Rich




More information about the MPlayer-cvslog mailing list