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

Ronald S. Bultje rsbultje
Sun Oct 28 15:39:00 CET 2007


Hi,

On 10/28/07, Ronald S. Bultje <rsbultje at gmail.com> wrote:
>
> 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?


Since I'm not getting any replies, here's a new thread with all the patches
needed to make it work on a Mac, I hope this catches attention and gets the
patches in. Please consider committing all of these such that ffserver and
udp in general works and is worth its LOC again.

1 - ffmpeg-bind.patch (from Nicolas), required such that we bind even if no
port number was supplied, in which case the we let the OS choose one for us.
Without the patch, such cases will not result in a bind in the ipv6-case,
which makes that case fail. With the patch, that works correctly.
2 - ffmpeg-rtsp-allow_two_instances.patch (from Luca, adapted), required
such that we always increase the port number that we try to connect to,
otherwise we may end up binding to the same port for multiple instances of
clients, which will obviously fail.
3 - ffmpeg-udp-connect_and_send.patch - replaces sendto() by connect() and
send(), which makes it work for MacOSX, where for some reason sendto() fails
with EINVAL (undocumented) for no obvious reason, where connect() and send()
with the same parameters works just fine. recvfrom() stays the way it is
because the man page suggests so.

With these patches, I am able to stream rtsp using ffserver to clients such
as ffplay and vlc over udp (tcp always worked already) with CONFIG_IPV6
enabled. Please apply all three.

Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-bind.patch
Type: application/octet-stream
Size: 2652 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071028/bf173801/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-rtsp-allow_two_instances.patch
Type: application/octet-stream
Size: 761 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071028/bf173801/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-udp-connect_and_send.patch
Type: application/octet-stream
Size: 2528 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071028/bf173801/attachment-0002.obj>



More information about the ffmpeg-devel mailing list