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

Jindrich Makovicka makovick
Sun Nov 16 10:19:26 CET 2008


On Sat, Nov 15, 2008 at 23:11, M?ns Rullg?rd <mans at mansr.com> wrote:
> "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().

Ok, this one should be portable.

-- 
Jindrich Makovicka
-------------- next part --------------
A non-text attachment was scrubbed...
Name: udp-nonblock.diff
Type: text/x-diff
Size: 810 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081116/47af7e76/attachment.diff>



More information about the ffmpeg-devel mailing list