[FFmpeg-devel] [PATCH] UDP fixes join multicast group on Darwin arch

Sébastien Zwickert szwickert
Mon Apr 20 12:26:01 CEST 2009


On Apr 20, 2009, at 11:12 AM, M?ns Rullg?rd wrote:

> S?bastien Zwickert <szwickert at kezia.com> writes:
>
>> On Apr 17, 2009, at 6:10 PM, Ronald S. Bultje wrote:
>>
>>> Hi,
>>>
>>> On Fri, Apr 17, 2009 at 10:25 AM, S?bastien Zwickert
>>> <szwickert at kezia.com> wrote:
>>>> I've read this archive
>>>> http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-August/051136.html
>>>> and
>>>> i've added the _DARWIN_C_SOURCE definition at the top of the udp.c
>>>> file.
>>>
>>> Putting it on the top of a random source file seems wrong, you  
>>> likely
>>> want to place a check in ./configure (check_cflags), preferrably  
>>> in an
>>> actual UDP test so it's only enabled when needed (OS X) and not for
>>> others...
>>
>> New patch in attachment that applies changes to the configure file.
>> I've added a test in the network check block to set - 
>> D_DARWIN_C_SOURCE
>> cflag when the target_os is darwin.
>>
>>
>> Index: configure
>> ===================================================================
>> --- configure	(revision 18631)
>> +++ configure	(working copy)
>> @@ -2121,6 +2121,10 @@
>>         check_type ws2tcpip.h socklen_t
>>         check_func_headers winsock2.h closesocket
>>     fi
>> +    # Needed for using struct ip_mreq with recent glibc on Darwin  
>> arch
>> +    if test $target_os = darwin; then
>> +        check_cflags -D_DARWIN_C_SOURCE
>
> It should be safe to use add_cflags here.  I don't see how -Dfoo could
> fail.

Now use add_cflags instead of check_cflags

>
>> +	fi
>
> That's a tab.
>
>> fi

Tab removed.

>>
>
> This adds the flag for all files, which I'm not convinced is a good
> idea either.  You never know what that might do.



Right, probably one reason for what i've first applied the changes in  
the udp.c source file.

So what's the best way to fix this bug that is os specific ?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: udp_multicast_darwin.patch
Type: application/octet-stream
Size: 476 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090420/dbd8ebd9/attachment.obj>
-------------- next part --------------









More information about the ffmpeg-devel mailing list