On Sun, 23 Jan 2022, Michael Niedermayer wrote:

On Wed, Jan 12, 2022 at 12:13:13AM -0500, Brad Smith wrote:
Fix setsockopt() usage on OpenBSD with IP_MULTICAST_TTL. The field
type should be an unsigned char on anything but Linux.


diff --git a/libavformat/udp.c b/libavformat/udp.c
index 180d96a988..29aa865fff 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -163,7 +163,13 @@ static int udp_set_multicast_ttl(int sockfd, int mcastTTL,
 {
 #ifdef IP_MULTICAST_TTL
     if (addr->sa_family == AF_INET) {
-        if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &mcastTTL, 
sizeof(mcastTTL)) < 0) {
+#ifdef __linux__
+        int ttl = mcastTTL;
+#else
+        unsigned char ttl = mcastTTL;
+#endif

this "ifdef __linux__" feels like the wrong thing to check, dont you agree ?

As far as I remember linux supports both sizes. So maybe just remove the check entirely?

Regards,
Marton
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to