diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-03-03 10:41:51 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-03-03 10:43:13 +0200 |
commit | a7ced98346c6d49c4569d1b609a773a042c46796 (patch) | |
tree | 681f39e9cb32fc0caebd973040265e39c519bf5c | |
parent | 406ed190acdba2007f42cc12d30ce4029cd1c3d1 (diff) |
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
-rw-r--r-- | gst/rtsp-server/rtsp-stream.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gst/rtsp-server/rtsp-stream.c b/gst/rtsp-server/rtsp-stream.c index 70abb99..272fbc9 100644 --- a/gst/rtsp-server/rtsp-stream.c +++ b/gst/rtsp-server/rtsp-stream.c @@ -1229,16 +1229,15 @@ again: goto no_udp_protocol; } - if (pool) { - GstRTSPAddressFlags flags; - - 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 (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) + 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); |