[FFmpeg-devel] [PATCH] IPv6 support v.2

Ronald S. Bultje rsbultje
Tue Oct 30 14:47:33 CET 2007


Hi,

On 10/28/07, Ronald S. Bultje <rsbultje at gmail.com> wrote:
>
> ffmpeg-ipv6-udp.patch - converts udp.c over to the new API, also removes
> all duplicated code for CONFIG_IPV6 except for the multicase setup.


And the attached patch updates this one to fix the address family mess
discussed elsewhere, and is updated for when that patch is applied.

This patch:
- removes all duplicated CONFIG_IPV6 code in udp.c
- ports the IPv4-code over to the new AVInetAddr API, thus making it a lot
smaller, simpler and still IPv6-compatible

Just in case people ask:
- I made a minor change in udp_set_remote_url() to set port=-1 to port=0,
this is because that is needed for getaddrinfo(), which returns an error if
port = -1. This was previously not needed because the ipv4-name resolution
API does not need a port as an argument
- A second small change is that I now check the return value of
udp_set_remote_url(), this is because I directly access the s->dest_addr
pointer below, so if it fails we should error out, else the code will
segfault on invalid hosts/ports. This was previously not needed because
dest_addr was not a pointer.
- lastly, I removed the av_mallocz() introdduced in a previous patch to zero
s->dest_addr, because s->dest_addr is now a pointer which I can just
initialize to NULL.

Apart from that, the patch looks big, but don't forget that most of that is
code removal. The actual changes are extremely minor and logical (apart from
what I mentioned above).

Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-ipv6-udp.patch
Type: application/octet-stream
Size: 8475 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071030/9f3cde6b/attachment.obj>



More information about the ffmpeg-devel mailing list