+ if (mux)
+ {
+ /* RTP/RTCP mux: duplicate the socket */
+#ifndef WIN32
+ fd = dup (rtp_fd);
+#else
+ WSAPROTOCOL_INFO info;
+ WSADuplicateSocket (rtp_fd, GetCurrentProcessId (), &info);
+ fd = WSASocket (info.iAddressFamily, info.iSocketType, info.iProtocol,
+ &info, 0, 0);
+#endif
+ }
+ else
+ {
+ /* RTCP on a separate port */
+ char dst[NI_MAXNUMERICHOST];
+ int dport;
+
+ if (net_GetPeerAddress (rtp_fd, dst, &dport))
+ return NULL;
+
+ sport++;
+ dport++;
+
+ fd = net_OpenDgram (obj, src, sport, dst, dport, AF_UNSPEC, proto);
+ }