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

Luca Abeni lucabe72
Thu Nov 8 09:09:42 CET 2007


Hi,

Luca Abeni wrote:
[...]
> I believe that some redundant code can be removed (reworking the code
> a little bit) without losing support for anything or changing any
> functionality... But I have no patches yet to prove this claim.
> I hope to send some example patches soon to clarify my idea (just give
> me the time to test some ideas).
And here are the patches. Lightly tested, on r10952, for both unicast and
multicast UDP, either with or without --disable-ipv6.

I generated the patches in a short time, so maybe some of them can have
typos or can be written in a better way, but I believe they show how to
remove duplicated code without (hopefully :) breaking anything.

- address-len.diff removes some stupid ifdef by using the dest_addr_len
   field in both the IPv4-only and the generic code. In this way, we decrease
   the differences between the two cases
- fix-multicast-mess.diff removes an useless field in struct UDPContext, and
   uses the same code in the IPv4-only and the generic code, renaming some
   functions with appropriate names
- remove_from.diff removes some more ifdefs by using recv() instead of recvfrom()
   (the "from" parameter was discarded anyway...)
- simplify-set-remote-url.diff removes some code duplictaion in udp_set_remote_url()

All the patches should introduce no changes in the behaviour of the functions,
and I believe that after applying them the code is more clear and readable,
and the differences between the protocol-independent code and the IPv4-only
are greatly reduced. Some work is still needed (especially in udp_open()), but
I think the patches give an idea about my plan of action... Do people agree
with it?


			Thanks,
				Luca
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: address-len.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071108/a1adb00a/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fix-multicast-mess.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071108/a1adb00a/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: remove_from.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071108/a1adb00a/attachment-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: simplify-set-remote-url.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071108/a1adb00a/attachment-0001.asc>



More information about the ffmpeg-devel mailing list