[FFmpeg-devel] MinGW network support

Михаил Мацнев mike
Thu May 17 06:52:10 CEST 2007

Alex Beregszaszi wrote:
>> pollbug.diff:
>> FD_SETSIZE is broken on Windows, this workarounds its. This patch is
>> needed for ffserver.
> Correct explanation:
> winsock is that broken, that it returns socket numbers like 1700, 1803,
> 1850. Without any linearity, nor starting at 0/1.
> While FD_SETSIZE is set to a relative low number, this will cause the
> poll not to work with those socket numbers, thus ffserver wont work. 
> I know this is a bad hack, but winsock documentation itself prefers
> this. Lol.
FD sets are implemented as arrays of FD numbers in Winsock, not as bitmasks,
so actual FD numbers are irrelevant when using fd_set and FD_* macros.
Using an FD_SETSIZE of 32768 wastes 128k of memory, and it would be quite
slow if that many descriptors were actually used.

More information about the ffmpeg-devel mailing list