Multicast address is not properly cached
There is an issue with multicast address usage. Modify
examples/test-multicast.c so that:
- Only the audio part is exposed in the factory (comment out the video part)
- Force the pool to only use one address and a single port pair:
gst_rtsp_address_pool_add_range (pool, "184.108.40.206", "220.127.116.11", 5000, 5001, 16);
We should therefore get the audio stream via 18.104.22.168:5000, but gst-rtsp-server fails hard.
What happens is the following:
- When the SDP is constructed, the code in question calls
gst_rtsp_stream_get_multicast_address()which will return the cached multicast address. If none are available, it will request it from the address pool (via
gst_rtsp_address_pool_acquire_address) and cache it. It properly returns 22.214.171.124:5000 (with 2 ports).
- Later on when the
SETUPrequest is handled, the transport is configured (
rtsp-client.c), which calls
- That code calls
alloc_ports_one_family()... and this is where things go wrong
That function does not check whether we already have a cached address (which we do) and therefore calls
gst_rtsp_address_pool_acquire_address() again ... which fails.
If we already have a cached address, we should use that.