GNOME Bugzilla – Bug 768933
stream: socket used by the multiudpsink is modified
Last modified: 2016-07-19 14:03:27 UTC
I haven't checked with wireshark if this is effectively happens, but reading the code I'm understanding this: When a media is shared and a 2nd client connects, it will allocate a new UDP socket for it and set it on the udpsink in alloc_ports_one_family(). My understanding is the source ip/port of future buffers sent to 1st client will suddenly change, no? Also there is theoretically a race I think: 1) client1 connects and addr1 is allocated for him. An udpsrc is created. The multiudpsink now uses addr1. 2) client2 connects and addr2 is allocated for him. Another udpsrc is created. The multiudpsink now uses addr2. 3) first buffer goes out of the multiudpsink, so with the packet will have "source" addr2. 4) Since RTSP clients uses the source address from udp package to know where to reply, both clients will reply on addr2. I've talked about this with Olivier Crête, and he thinks there is no reason to allocate new socket/udpsrc for every client. According to him, udpsrc can receive from any clients, and rtpbin is capable of filtering which buffer comes from which client. Current code puts every udpsrc into a funnel anyway.
We shouldn't have more than one udpsrc in the first place. That's another regression introduced by: commit f62a9a7eb9fda096fb88c013d6787c28090037a2 Author: Patricia Muscalu <patricia@axis.com> Date: Tue Feb 23 14:59:32 2016 +0100 rtsp-stream: postpone UDP socket allocation until SETUP Postpone the allocation of the UDP sockets until we know what transport has been chosen by the client. Both unicast and multicast UDP sources are created in one function. https://bugzilla.gnome.org/show_bug.cgi?id=757488 Working on a proper fix in bug #766612 *** This bug has been marked as a duplicate of bug 766612 ***