rtsp-stream: Use cached address when allocating sockets

If an address/port was previously decided upon (ex: multicast in the
SDP), then use that instead of re-creating another one

Fixes https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/issues/57
This commit is contained in:
Edward Hervey 2019-01-29 14:42:35 +01:00 committed by Edward Hervey
parent ae32203cb0
commit a48711fa9d

View file

@ -1076,7 +1076,8 @@ no_address:
* won't release the address from the pool.
*
* Returns: (nullable): the #GstRTSPAddress of @stream or %NULL when
* the address could be reserved. gst_rtsp_address_free() after usage.
* the address could not be reserved. gst_rtsp_address_free() after
* usage.
*/
GstRTSPAddress *
gst_rtsp_stream_reserve_address (GstRTSPStream * stream,
@ -1448,7 +1449,10 @@ again:
else
flags |= GST_RTSP_ADDRESS_FLAG_IPV4;
addr = gst_rtsp_address_pool_acquire_address (pool, flags, 2);
if (*server_addr_out)
addr = *server_addr_out;
else
addr = gst_rtsp_address_pool_acquire_address (pool, flags, 2);
if (addr == NULL)
goto no_address;