[FFmpeg-devel] UDP multicasts mixed up on receive due to wrong bind()

Benoit Fouet benoit.fouet
Wed Nov 12 14:15:19 CET 2008


Hi,

Le mercredi 12 novembre 2008 ? 09:52 +0100, Luca Abeni a ?crit :
> Hi,
> 
> Jindrich Makovicka wrote:
> [...]
> >>> Can we fix this issue ?
> >> AFAIR, what we miss is a patch that works on as many systems as possible.
> >> I think we arrived to the conclusion that the best thing to do is:
> >> first, try to bind the multicast group; then, if the first bind fails,
> >> try to bind INADDR_ANY. Both Jindrich's patch and my one are missing
> >> the second part...
> > 
> > This version tries the binding of the local address if the multicast
> > bind fails. I didn't test it on windows though.
> 
> This looks fine. I am not udp.c maintainer, but I think that it should
> be applied (assuming that you tested it on windows) in 3 or 4 days if
> no windows user provides feedback.
> 
> Just a minor nit:
> [...]
> +    if (bind_ret < 0) {
> +        if (bind(udp_fd,(struct sockaddr *)&my_addr, len) < 0)
> +            goto fail;
> +    }
> I think this should be applied without re-indenting the code, and
> re-indentation should be done in a second commit (also, the "{" and
> "}" are not needed, I think).
> 

I'd even say it should be done in a single if()

-- 
Ben





More information about the ffmpeg-devel mailing list