[Ffmpeg-devel] Network patch for MingW users

Michel Bardiaux mbardiaux
Tue Feb 20 11:28:39 CET 2007


M?ns Rullg?rd wrote:
> Michel Bardiaux said:
>> M?ns Rullg?rd wrote:
>>> Michel Bardiaux said:
>>>> Fran?ois Revol wrote:
>>>> [snip]
>>>>
>>>>>>> +#ifdef __MINGW32__
>>>>>>> +    init_winsock();
>>>>>>> +#endif
>>>>>> Aaaaiiiieeee!  NO MORE OF THIS. PLEASE.
>>>>> Also that's totally definitely non threadsafe.
>>>> Why? AFAIK WSAStartup is threadsafe. See e.g.
>>>> http://www.tangentsoft.net/wskfaq/
>>> Of more interest is what happens if WSAStartup() is called more than once.
>>> Likewise for WSACleanup()
>>>
>> What do you mean by that? That WSAStartup should not be called more than
>> once? It can.
> 
> Good.  I wasn't sure.  Do calls to WSAStartup/WSACleanup nest properly too?
> 
Not sure what you mean by 'nest'. The MS docs state that for each 
WSAStartup there must be exactly one WSACleanup, but only the last one 
will actually cleanup anything. In my experience, as long as you have 
your own finalizers for sockets, you can omit WSACleanup without any 
harm done. Of course, I dont make any promises about advanced stuff :-( 
like DDE/RPC/OLE/...

-- 
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux at mediaxim.be

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/




More information about the ffmpeg-devel mailing list