[FFmpeg-trac] #9449(avformat:new): FFmpeg UDP multicast support broken on OpenBSD
FFmpeg
trac at avcodec.org
Sat Oct 9 00:15:53 EEST 2021
#9449: FFmpeg UDP multicast support broken on OpenBSD
-------------------------------------+-------------------------------------
Reporter: Brad Smith | Type: defect
Status: new | Priority: important
Component: avformat | Version: git-
Keywords: udp | master
multicast | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
The FFmpeg UDP multicast support is broken on OpenBSD.
$ ffmpeg -i https://ftp.openbsd.org/pub/OpenBSD/songs/song69.ogg \
> "udp://239.255.0.1:9000?ttl=10"
(...)
setsockopt(IP_MULTICAST_TTL): Invalid argument
udp://239.255.0.1:9000?ttl=10: Invalid argument
The mcastTTL parameter should be of the type unsigned char not int when
passed to IP_MULTICAST_TTL via setsockopt(). This appears to be the case
with all of the UNIX OS's I can find (Linux, all of the BSD's, Solaris,
AIX, IRIX, etc.)
{{{
static int udp_set_multicast_ttl(int sockfd, int mcastTTL,
struct sockaddr *addr)
{
#ifdef IP_MULTICAST_TTL
if (addr->sa_family == AF_INET) {
if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &mcastTTL,
sizeof(mcastTTL)) < 0) {
ff_log_net_error(NULL, AV_LOG_ERROR,
"setsockopt(IP_MULTICAST_TTL)");
return ff_neterrno();
}
}
#endif
#if defined(IPPROTO_IPV6) && defined(IPV6_MULTICAST_HOPS)
if (addr->sa_family == AF_INET6) {
if (setsockopt(sockfd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS,
&mcastTTL, sizeof(mcastTTL)) < 0) {
ff_log_net_error(NULL, AV_LOG_ERROR,
"setsockopt(IPV6_MULTICAST_HOPS)");
return ff_neterrno();
}
}
#endif
return 0;
}
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9449>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list