[FFmpeg-devel] [PATCH] Make RTP work with IPv6 enabled

Luca Abeni lucabe72
Tue Oct 30 15:15:34 CET 2007

Ronald S. Bultje wrote:
> Hi Luca,
> On 10/30/07, Luca Abeni <lucabe72 at email.it> wrote:
>>> With this patch, I can stream rtp/udp from ffserver.
>> Arg... My head is spinning again :(
>> The changes discussed in this email should affect the rtsp demuxer, not
>> ffserver (ffserver always specify a remote host when opening rtp://
>> URLs)...
> Both. make your head spin a bit more:
> With this patch, udp.c takes the target family in account when determining
> the family of the local host address (see the changes in udp.c) that it
> bind()s to. That is a change for both client and server.
Ok, so I guess the key is:

+    int family = AF_UNSPEC;

-    res0 = udp_ipv6_resolve_host(0, s->local_port, SOCK_DGRAM, AF_UNSPEC, AI_PASSIVE);
+    if (((struct sockaddr *) &s->dest_addr)->sa_family)
+        family = ((struct sockaddr *) &s->dest_addr)->sa_family;
+    res0 = udp_ipv6_resolve_host(0, s->local_port, SOCK_DGRAM, family, AI_PASSIVE);

Right? I agree that this looks the correct thing to do, and I guess it
should be committed.

> Later, both (ff)server and client (ffplay) fail on the rtcp, which they both
> bind() to and write data to, and that is what the changes in rtsp.c/rtpproto.c
> are needed for (plus, again, the changes in udp.c).
The changes in rtpproto.c only affect rtp_set_remote_url(), right?
That function is only called in rtsp.c, right? And I do not see how it can be
called without specifying the destination port...


More information about the ffmpeg-devel mailing list