[FFmpeg-devel] [PATCH] Make RTP work with IPv6 enabled

Måns Rullgård mans
Sat Oct 13 20:19:13 CEST 2007

"Ronald S. Bultje" <rsbultje at gmail.com> writes:

> Hi Nicolas,
> On 10/12/07, Nicolas George <nicolas.george at normalesup.org> wrote:
>> The (one?) problem with the current behavior is RTP: RTP needs two
>> consecutive ports. The current implementation gets a first socket with an
>> ephemeral port, then requests the next port. If the ephemeral port is not
>> bound, it fails (trying to bind port 1).
> I don't think the bind() should be needed per se, though, I mean, recv()
> should be good enough since it is udp anyway. Is there a way to assign that
> port by setting a reasonable default or derive the local private port
> without doing the bind()?

That is exactly what bind() does.  It binds a socket to a port.  If a
port number of zero is specified, the system will choose a free one.

A protocol requiring consecutive ephemeral port numbers is badly
designed since there is no good way of reserving such ports.  The best
one can do is try repeatedly and hope to eventually succeed.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list