[FFmpeg-devel] Quick Patch for Multicast UDP Receive on macOS

ffmpeg at gallery.co.uk ffmpeg at gallery.co.uk
Thu Aug 16 19:49:26 EEST 2018


> On 16 Aug 2018, at 17:43, Thilo Borgmann <thilo.borgmann at mail.de> wrote:
> 
> Hi,
> 
>> --- /Users/mark/Downloads/udpORIG.c	2018-08-16 15:39:21.000000000 +0100
>> +++ /Users/mark/Downloads/udp.c	2018-08-16 15:40:55.000000000 +0100
>> @@ -828,7 +828,11 @@
>>        s->reuse_socket = 1;
>>        if (setsockopt (udp_fd, SOL_SOCKET, SO_REUSEADDR, &(s->reuse_socket), sizeof(s->reuse_socket)) != 0)
>>            goto fail;
>> -    }
>> +  #ifdef __APPLE__  // MacOS/X requires an additional call 
>> +        if (setsockopt (udp_fd, SOL_SOCKET, SO_REUSEPORT, &(s->reuse_socket), sizeof(s->reuse_socket)) != 0)
>> +            goto fail;
>> +  #endif
>> +      }
>> 
>>    if (s->is_broadcast) {
>> #ifdef SO_BROADCAST
> 
> Not sure but that might also affect other BSD derivatives like Gentoo... can you test on Linux and some BSD also?
> (I've got no other BSD kind of OS other than OSX)

Its certainly NOT an issue on Ubuntu Linux.

I don't have any other BSD variants to test with either, sorry.
This is a fairly well documented quirk of macOS, however.

> 
> -Thilo
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel



More information about the ffmpeg-devel mailing list