rtsp-stream: Only use the address pool for unicast UDP if it contains unicast addresses

Otherwise we fail to allocate UDP ports if the pool only contains multicast
addresses, which is something that used to work before. For unicast addresses
if the pool contains none, we just allocate them as if there is no pool at
all.

https://bugzilla.gnome.org/show_bug.cgi?id=757488
This commit is contained in:
Sebastian Dröge 2016-03-03 10:41:51 +02:00
parent 406ed190ac
commit a7ced98346

View file

@ -1229,16 +1229,15 @@ again:
goto no_udp_protocol;
}
if (pool) {
GstRTSPAddressFlags flags;
if (pool && ((transport == GST_RTSP_LOWER_TRANS_UDP &&
gst_rtsp_address_pool_has_unicast_addresses (pool))
|| transport == GST_RTSP_LOWER_TRANS_UDP_MCAST)) {
GstRTSPAddressFlags flags = GST_RTSP_ADDRESS_FLAG_EVEN_PORT;
if (transport == GST_RTSP_LOWER_TRANS_UDP &&
gst_rtsp_address_pool_has_unicast_addresses (pool))
flags = GST_RTSP_ADDRESS_FLAG_EVEN_PORT | GST_RTSP_ADDRESS_FLAG_UNICAST;
else if (transport == GST_RTSP_LOWER_TRANS_UDP_MCAST)
flags = GST_RTSP_ADDRESS_FLAG_EVEN_PORT | GST_RTSP_ADDRESS_FLAG_MULTICAST;
if (transport == GST_RTSP_LOWER_TRANS_UDP)
flags |= GST_RTSP_ADDRESS_FLAG_UNICAST;
else
goto no_ports;
flags |= GST_RTSP_ADDRESS_FLAG_MULTICAST;
if (addr)
rejected_addresses = g_list_prepend (rejected_addresses, addr);