[libav-devel] [PATCH 1/3] rtsp: Use a random offset for trying to open UDP ports for RTP

2012-01-20 Thread Martin Storsjö
From: Dmitry Volyntsev This avoids (for all practical cases) the issue of reusing the same UDP port as for an earlier connection. If the remote doesn't know the previous session was closed, he might keep on sending packets to that port. If we always start off trying to open the same UDP port, we

Re: [libav-devel] [PATCH 1/3] rtsp: Use a random offset for trying to open UDP ports for RTP

2012-01-20 Thread Luca Barbato
On 20/01/12 13:45, Martin Storsjö wrote: > +port_off = av_get_random_seed() % (RTSP_RTP_PORT_MAX - > RTSP_RTP_PORT_MIN); Not sure if it might have an impact on performance and/or randomness availability. lu -- Luca Barbato Gentoo/linux http://dev.gentoo.org/~lu_zero _

Re: [libav-devel] [PATCH 1/3] rtsp: Use a random offset for trying to open UDP ports for RTP

2012-01-20 Thread Martin Storsjö
On Fri, 20 Jan 2012, Luca Barbato wrote: On 20/01/12 13:45, Martin Storsjö wrote: +port_off = av_get_random_seed() % (RTSP_RTP_PORT_MAX - RTSP_RTP_PORT_MIN); Not sure if it might have an impact on performance and/or randomness availability. Shouldn't be an issue, av_get_random_seed() us