[Ffmpeg-devel] Network patch for MingW users

Måns Rullgård mans
Wed Feb 21 15:47:52 CET 2007


Alex Beregszaszi said:
> Hi,
>
>> >> > Possible changes:
>> >> > * move neterrno to os_support.h or network.h
>> >> > * create socketblockio (or something similar) for setting non-blocking
>> >> > io on socket
>> >
>> > These two macros should be moved into os_support.h or network.h?
>>
>> Actually, I don't like the neterrno macro at all.  I'd prefer a macro
>> for retrieving the error code and some form of translation from E* codes
>> to WS* codes.  The former of these would simply return errno on POSIX
>> systems and call WSAGetLastErrorUsingAnUglyFunctionName() on Windows.  The
>> latter I don't know exactly what is required for.
>
> Actually neterrno() does the same what you say.

Does not.  In the patch you sent, it compares something to the supplied
argument, which I find confusing.  That's not how things normally operate.

>> For setting nonblocking mode, I'd like a function (or macro) like
>>
>> int ff_socket_nonblock(int enable);
>>
>> defined os_support.c (or network.h).
>
> /**
>  * sets the non-blocking io on socket
>  */
> static inline int av_socket_nonblock(int socket, int enable)

Why av_?  I don't think this deserves being part of the public API.

> {
> #ifdef __MINGW32__
>    return ioctlsocket(socket, FIONBIO, enable);
> #else
>    if (enable)
>       return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) | O_NONBLOCK);
>    else
>       return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) | ~O_NONBLOCK);

s/|/&/

> #endif
> }
>
>> > Btw, what about merging barpainet.h into network.h?
>>
>> First I'd like to determine whether its contents are actually needed at all.
>> barpainet.h is only #included in os_support.c, and then only if inet_aton()
>> doesn't exist, and none of what is in it is used there.
>>
>> I've repeatedly asked the Beos guys about this, but they haven't answered.
>> If I don't get an answer by the end of the week, I'll remove it.
>
> As barpainet.h is only used in one place (os_support.c), it might be a
> better idea merging it into that place instead network.h

It's *included* in one place.  Not even there is it used.  Hence my wish to
simply delete it.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list