- p_sys->fd = b_framed
- ? net_ConnectTCP( p_access, psz_server_addr, i_server_port )
- : net_OpenDgram( p_access, psz_bind_addr, i_bind_port,
- psz_server_addr, i_server_port, fam, proto );
+ switch (proto)
+ {
+ case IPPROTO_UDP:
+ case IPPROTO_UDPLITE:
+ p_sys->fd = net_OpenDgram( p_access, psz_bind_addr, i_bind_port,
+ psz_server_addr, i_server_port, fam,
+ proto );
+ break;
+
+ case IPPROTO_TCP:
+ p_sys = net_ConnectTCP( p_access, psz_server_addr, i_server_port );
+ p_sys->b_framed_rtp = VLC_TRUE;
+ break;
+
+ case IPPROTO_DCCP:
+#ifdef SOCK_DCCP
+ p_sys->fd = net_Connect( p_access, psz_server_addr, i_server_port,
+ SOCK_DCCP, IPPROTO_DCCP );
+#else
+ p_sys->fd = -1;
+ msg_Err( p_access, "DCCP support not compiled-in!" );
+#endif
+ break;
+ }