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

Sascha Sommer saschasommer at freenet.de
Fri May 13 10:38:33 CEST 2005


Hi,

Am Donnerstag, den 12.05.2005, 20:52 -0400 schrieb Rich Felker:
> 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
> 

The unix behaviour did not change, as the comment describes closesocket
is defined to close on unix, so it will always call close like it was
before the commit. I doubt you can play file:// urls or files containing
:// in their pathname on windows. I might be mistaken, though.

Sascha




More information about the MPlayer-cvslog mailing list