[FFmpeg-devel] Network patch for testing
Michael Niedermayer
michaelni
Sat Aug 18 17:38:50 CEST 2007
Hi
On Fri, Aug 10, 2007 at 12:51:27PM +0200, Luca Abeni wrote:
> Hi all,
>
> the network code was causing some problems to me (see my previous email
> "Strange code in libavformat/udp.c:udp_open()", sent on 07/13/2007), so I
> modified the code and prepared a patch that fixes my problems.
>
> Now, I only tested my patch while streaming RTP under Linux, so I do not
> know if introduces regressions for other users. I attach it so that people
> interested in ffmpeg networking can test the patch for their use cases, and
> see if it introduces problems.
> Also, I'd like to know other people's opinions on this patch.
[...]
> @@ -328,8 +326,8 @@
>
> my_addr.sin_family = AF_INET;
> my_addr.sin_addr.s_addr = htonl (INADDR_ANY);
> - if (s->is_multicast && !(h->flags & URL_WRONLY)) {
> - /* special case: the bind must be done on the multicast address port */
> + s->is_multicast = IN_MULTICAST(ntohl(s->dest_addr.sin_addr.s_addr));
> + if (!(h->flags & URL_WRONLY)) {
> my_addr.sin_port = s->dest_addr.sin_port;
> } else {
> my_addr.sin_port = htons(s->local_port);
> @@ -370,7 +368,8 @@
> }
> #endif
> #else
> - if (s->is_multicast && !(h->flags & URL_WRONLY))
> + s->is_multicast = IN6_IS_ADDR_MULTICAST(&(((struct sockaddr_in6 *)&s->dest_addr)->sin6_addr));
> + if (!(h->flags & URL_WRONLY))
> s->local_port = port;
> udp_fd = udp_ipv6_set_local(h);
> if (udp_fd < 0)
these 2 hunks change more then just "find is_multicast from IP"
could you elaborate on them?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
No great genius has ever existed without some touch of madness. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070818/f01ccfc9/attachment.pgp>
More information about the ffmpeg-devel
mailing list