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, "224.3.0.1", "224.3.0.1", 5000, 5001, 16);
We should therefore get the audio stream via 224.3.0.1: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 (viagst_rtsp_address_pool_acquire_address
) and cache it. It properly returns 224.3.0.1:5000 (with 2 ports). - Later on when the
SETUP
request is handled, the transport is configured (default_configure_client_transport()
fromrtsp-client.c
), which callsgst_rtsp_stream_allocate_udp_sockets()
. - 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.