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

Ronald S. Bultje rsbultje
Sun Oct 28 06:33:26 CET 2007


Hi,

I'm just mumbling here to keep you updated on the problem, hoping for some
useful pointers.

On 10/22/07, Luca Abeni <lucabe72 at email.it> wrote:
>
> > Data transfer per se shoult not be the problem, clearly, since vlc +
> ffserver
> > works in all cases.
> It would be interesting to see a dump of the network packets (with
> wireshark
> or tcpdump), just to be 100% sure about what's going on.


It's udp, but I'll take this whole thing back, since looking at the debug
closer, it appears vlc fails on udp also, and falls back to tcp after that.
Then it works. This shows the problem is in ffserver, or more precisely in
udp.c (see below).

I read your proposed patch (after noticing +/- 5 stale ffplay processes :-)
) in another thread and was able to get ffplay going w/o CONFIG_IPV6 again,
so that part is solved now. However, even with the patches in recent
threads, CONFIG_IPV6 doesn't work with udp. Set up is correct, the bind()
succeeds but the sendto() in udp_write() fails completely unexpectedly with
EINVAL, which isn't even documented in its manpage. I've read two cases
where sendto() can return (as errno, with ret=-1) EINVAL so far, one is
where the port number changes (apparently not allowed) and the other is
where tolen (the size of the address) is way long, e.g. 128. However, the
size is not longer than in the ipv4 case, and the port number doesn't change
any other way than in the ipv4 case afaics. I don't know how else it can
return EINVAL, the Linux manpage isn't very useful ("invalid parameters")
and the BSD one only mentions the tolen argument being invalid...

If I split the sendto() into a separate connect() in udp_open() followed by
send() in udp_write(), the whole thing works as expected, but I guess that
won't go together with apps calling udp_set_remote_url() manually... Best
way may be to re-arrange udp.c a bit to first set up the local part in
udp_open() and then call connect() in set_remote_url() and send() / recv()
instead of sendto() / recvfrom() in udp_read/write(), or is that a bad idea?

(I still don't know what the bug is, but I suppose sendto() is just broken
on macs (?)...)

Ronald

Ronald




More information about the ffmpeg-devel mailing list