[MPlayer-dev-eng] latest mingw network patch

flo/yepyep flodt8 at yahoo.de
Mon Jun 9 08:57:27 CEST 2003


 --- Bertrand Baudet <bertrand_baudet at yahoo.com> wrote:

(...)
> So yes, please change the DATADIR define to MP_DATADIR or
> MPLAYER_DATADIR
(...)
> > - maybe
> > #ifndef HAVE_WINSOCK2
> > #define closesocket(x) close(x)
> > #endif
> > and changing socket closes to closesocket() is easier
> > than #if closesocket() #else close() #fi everywhere
> 
> I second that.

Okay, sounds much better to me as well :-) I will send a new patch
with those changes then. If someone else volunteers for the DATADIR
to MPLAYER_DATADIR changes (as Arpi suggested) that would be nice
too, of course.

By the way - as it might also be a good thing to keep in mind for G2
- it is always a good idea to keep network- and file-IO completely
seperate, and handle those in different codepaths.

on unix it is obviously easy to use different routines only to open a
file (open() vs. socket()), and after that treat them the same by
using read()/write() and close() - as i think i've seen it happen for
some other project.
that might not be a very good thing to do if you wish to easily port
the network code to windows later, since winsock only has recv/send
and closesocket. the better idea is to use recv/send from the start
(also for clarity what they do).
especially watch out that you use seperate close()s for network and
file stuff (don't just close() no matter what it might be) :)

flo/yepyep

__________________________________________________________________

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Logos und Klingeltöne fürs Handy bei http://sms.yahoo.de



More information about the MPlayer-dev-eng mailing list