[Ffmpeg-devel] Re: Network patch for MingW users

Ramiro Ribeiro Polla ramiro
Mon Mar 19 18:18:11 CET 2007


Ryan Martell wrote:
>
> On Feb 19, 2007, at 11:42 PM, Fran?ois Revol wrote:
>>>>  #ifdef __MINGW32__
>>>>  __declspec(dllimport) void __stdcall Sleep(unsigned long
>>>> dwMilliseconds);
>>>>  // #  include <windows.h>
>>>> +#define GUID microsoft_issue_GUID
>>>> +#include <winsock.h>
>>>> +#undef GUID
>>>>  #  define usleep(t)    Sleep((t) / 1000)
>>>> -#  include <fcntl.h>
>>>> -#  define lseek(f,p,w) _lseeki64((f), (p), (w))
>>>> +#  define sleep(t)     Sleep((t) * 1000)
>>>> +#define O_NONBLOCK FIONBIO
>>>> +#define fcntl(fd,b,c) { u_long arg=1L; \
>>>> +                        ioctlsocket(fd, c, &arg); }
>>>
>>> I'm not convinced this is a good idea.  Someone might use fcntl() on
>>> a
>>> real file.
>>
>> Why not just define a fcntlsocket() that other OSes would just map to
>> fcntl like is done for close already ? Much cleaner.
>>
>>>>      if (port <= 0 || port >= 65536)
>>>>          goto fail;
>>>>
>>>> +#ifdef __MINGW32__
>>>> +    init_winsock();
>>>> +#endif
>>>
>>> Aaaaiiiieeee!  NO MORE OF THIS. PLEASE.
>>
>> Also that's totally definitely non threadsafe.
>
> fcntlsocket() as above..
>
> and
>
> initialize_sockets() and shutdown_sockets(), which do nothing on real 
> os's, but does the init_winsock thing on windows?
>
> -Ryan
>
> PS: I volunteer to put the patch together, once everyone comes to a 
> consensus on how to do it....

Ping.

Are you still volunteering for this?

I suggest you don't wait for consensus on everything to put the patch 
together. Post extremely simple patches that deal with one issue at a 
time. Wait for one to get committed to send the next one. It will take 
long, but it's more probable to get done.

Also, make the patches look like they're not Windows related. It gets 
way less attention and much more resistance on the list if it's 
Windows-only.

Take 
http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/2007-January/005631.html 
for example. I never mentioned it was sent to fix networking support on 
Windows... It got applied.

Ramiro Polla




More information about the ffmpeg-devel mailing list