[FFmpeg-devel] [PATCH] UDP hangs with no input data

Måns Rullgård mans
Sat Nov 15 23:11:54 CET 2008


"Kenan Gillet" <kenan.gillet at gmail.com> writes:

> Hi,
>
> On Fri, Nov 14, 2008 at 6:38 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
>> Hi,
>>
>> On Fri, Nov 14, 2008 at 2:42 PM, elupus <elupus at ecce.se> wrote:
>>> On Thu, 13 Nov 2008 11:05:38 +0100, Jindrich Makovicka wrote:
>>>
>>> +        len = recv(s->udp_fd, buf, size, MSG_DONTWAIT);
>>>
>>> Doubt this will work in mingw, don't think msg_dontwait is defined. Should
>>> probably also include a #ifndef msg_dontwait #define msg_dontwait 0 #endif
>>> in the win32 section in os_support.h
>>
>> I also get a missing define on OSX 10.4... Not sure what header
>> normally contains this.
>>
>
> I also have a missing define on OS 10.5.
>
> the define is in /usr/include/sys/socket.h but under #if:
>
> #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
> #define	MSG_DONTWAIT	0x80		/* this message should be nonblocking */

MSG_DONTWAIT is not a standard flag, so we should not be using it.
The standard method is to set O_NONBLOCK on the socket using fcntl().

> I am not sure about the policy for OS specific #ifdef,

The policy is no.

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




More information about the ffmpeg-devel mailing list