rtsp: Use a random offset for trying to open UDP ports for RTP
authorDmitry Volyntsev <xeioexception@gmail.com>
Wed, 18 Jan 2012 09:46:37 +0000 (13:46 +0400)
committerMartin Storsjö <martin@martin.st>
Sat, 21 Jan 2012 23:10:03 +0000 (01:10 +0200)
commit58f0978581bf736ac6888fe3013f0c5ac88bfbdc
tree14d211db8f9a18f912cb18edf97506044dd485d5
parentdbb06b8c0d7020d4a95ef8b2831aa58ec00145c7
rtsp: Use a random offset for trying to open UDP ports for RTP

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 might get those packets intermixed
with the new ones.

This is occasionally an issue when testing RTSP stuff with
DSS, perhaps also with other servers.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtsp.c