⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 patch_vlc-0.8.5

📁 udp-lite for upd lite linux kernel
💻 5
字号:
--- vlc-0.8.5/src/network/udp.c	2006-05-06 16:52:13.000000000 +0100+++ vlc-0.8.5UDP-Lite/src/network/udp.c	2006-07-24 17:57:19.000000000 +0100@@ -203,8 +203,11 @@         int fd;         char *psz_mif; -        fd = net_Socket( p_this, ptr->ai_family, ptr->ai_socktype,-                         ptr->ai_protocol );+#ifdef IPPROTO_UDPLITE		/* use UDP-Lite protocol instead of UDP */+        fd = net_Socket( p_this, ptr->ai_family, ptr->ai_socktype, IPPROTO_UDPLITE );+#else  				/* ai_protocol defaults to 0 (UDP)      */+        fd = net_Socket( p_this, ptr->ai_family, ptr->ai_socktype, ptr->ai_protocol );+#endif         if( fd == -1 )             continue; #if !defined( SYS_BEOS )@@ -228,6 +231,16 @@         } #endif +#ifdef IPPROTO_UDPLITE 	/* set UDP-Lite checksum coverage */+	i_val = UDPLITE_CSCOV;+      //  if ( setsockopt(fd, SOL_UDPLITE, UDPLITE_RECV_CSCOV, &i_val, sizeof(i_val)) < 0 ) {+        if ( setsockopt(fd, SOL_UDPLITE, UDPLITE_SEND_CSCOV, &i_val, sizeof(i_val)) < 0 ) {+            msg_Warn( p_this, "Can not set UDP-Lite sender coverage (%s)", strerror(errno));+            net_Close( fd );+            continue;+        }+#endif+         if( i_hlim > 0 )             net_SetMcastHopLimit( p_this, fd, ptr->ai_family, i_hlim );         psz_mif = config_GetPsz( p_this, (ptr->ai_family != AF_INET)--- vlc-0.8.5/modules/misc/network/ipv4.c	2006-05-06 16:52:17.000000000 +0100+++ vlc-0.8.5UDP-Lite/modules/misc/network/ipv4.c	2006-07-24 18:25:09.000000000 +0100@@ -183,6 +183,7 @@      p_socket->i_handle = -1; +#ifndef IPPROTO_UDPLITE      /* Open a SOCK_DGRAM (UDP) socket, in the AF_INET domain, automatic (0)      * protocol */     if( (i_handle = socket( AF_INET, SOCK_DGRAM, 0 )) == -1 )@@ -190,7 +191,22 @@         msg_Warn( p_this, "cannot create socket (%s)", strerror(errno) );         return 0;     }+#else        /* UDP-Lite is supported on this host */ +    /* Open a SOCK_DGRAM socket, using the PF_INET domain, UDP-Lite (136) protocol */+    if( (i_handle = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDPLITE)) == -1 ) +    {+        msg_Warn( p_this, "Cannot create UDP-Litev4 socket (%s)", strerror(errno) );+        return 0;+    }++    /* set UDP-Lite receiver checksum coverage */+    i_opt = UDPLITE_CSCOV;+    if ( setsockopt(i_handle, SOL_UDPLITE, UDPLITE_RECV_CSCOV, &i_opt, sizeof(i_opt)) < 0 ) {+        msg_Warn( p_this, "Cannot set UDP-Litev4 receiver coverage (%s)", strerror(errno) );+        return 0;+    }+#endif     /* We may want to reuse an already used socket */     i_opt = 1;     if( setsockopt( i_handle, SOL_SOCKET, SO_REUSEADDR,--- vlc-0.8.5/modules/misc/network/ipv6.c	2006-05-06 16:52:17.000000000 +0100+++ vlc-0.8.5UDP-Lite/modules/misc/network/ipv6.c	2006-07-24 18:25:24.000000000 +0100@@ -169,6 +169,7 @@     if ( BuildAddr( p_this, &sock, psz_bind_addr, i_bind_port ) == -1 )                 return 0; +#ifndef IPPROTO_UDPLITE      /* Open a SOCK_DGRAM (UDP) socket, in the AF_INET6 domain, automatic (0)      * protocol */     if( (i_handle = socket( AF_INET6, SOCK_DGRAM, 0 )) == -1 )@@ -176,6 +177,22 @@         msg_Warn( p_this, "cannot create socket (%s)", strerror(errno) );         return 0;     }+#else        /* UDP-Lite is supported on this host */++    /* Open a SOCK_DGRAM socket, using the PF_INET domain, UDP-Lite (136) protocol */+    if( (i_handle = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDPLITE)) == -1 ) +    {+        msg_Warn( p_this, "Cannot create UDP-Litev6 socket (%s)", strerror(errno) );+        return 0;+    }++    /* set UDP-Lite receiver checksum coverage */+    i_opt = UDPLITE_CSCOV;+    if ( setsockopt(i_handle, SOL_UDPLITE, UDPLITE_RECV_CSCOV, &i_opt, sizeof(i_opt)) < 0 ) {+        msg_Warn( p_this, "Cannot set UDP-Litev6 receiver coverage (%s)", strerror(errno) );+        return 0;+    }+#endif  #ifdef IPV6_V6ONLY     val.i_int = p_socket->v6only;--- vlc-0.8.5/include/network.h	2006-05-06 16:52:25.000000000 +0100+++ vlc-0.8.5UDP-Lite/include/network.h	2006-07-24 18:12:18.000000000 +0100@@ -61,6 +61,14 @@ extern "C" { # endif +/* UDP-Lite configuration (patched) */+#ifdef IPPROTO_UDPLITE                /* defined in netinet/in.h    */+#include <netinet/udplite.h>          /* protocol constants         */+#define UDPLITE_CSCOV 8               /* standard checksum coverage */+#else+#warning "UDP-Lite patch applied, but apparently no system support for UDP-Lite"+#endif+	 /*****************************************************************************  * network_socket_t: structure passed to a network plug-in to define the  *                   kind of socket we want--- vlc-0.8.5/share/http/dialogs/input	2006-05-06 16:52:13.000000000 +0100+++ vlc-0.8.5UDP-Lite/share/http/dialogs/input	2006-07-25 11:16:33.000000000 +0100@@ -156,7 +156,7 @@         <tr>           <td>             <input type="radio" name="input_net_type" id="input_net_udp" value="udp" onchange="update_input_net();" />-            <label for="input_net_udp">UDP/RTP</label>+            <label for="input_net_udp">UDP-Lite/RTP</label>           </td>           <td>             <label for="input_net_udp_port">Port</label>@@ -168,7 +168,7 @@         <tr>           <td>             <input type="radio" name="input_net_type" id="input_net_udpmcast" value="udpmcast" onchange="update_input_net();" />-            <label for="input_net_udpmcast">UDP/RTP Multicast</label>+            <label for="input_net_udpmcast">UDP-Lite/RTP Multicast</label>           </td>           <td>             <label for="input_net_udpmcast_address">Address</label>--- vlc-0.8.5/modules/gui/wxwidgets/dialogs/open.cpp	2006-05-06 16:52:17.000000000 +0100+++ vlc-0.8.5UDP-Lite/modules/gui/wxwidgets/dialogs/open.cpp	2006-07-25 11:17:16.000000000 +0100@@ -801,8 +801,8 @@      static const wxString net_type_array[] =     {-        wxU(_("UDP/RTP")),-        wxU(_("UDP/RTP Multicast")),+        wxU(_("UDP-Lite/RTP")),+        wxU(_("UDP-Lite/RTP Multicast")),         wxU(_("HTTP/HTTPS/FTP/MMS")),         wxU(_("RTSP"))     };--- vlc-0.8.5/modules/access/udp.c	2006-05-06 16:52:18.000000000 +0100+++ vlc-0.8.5UDP-Lite/modules/access/udp.c	2006-07-25 11:19:13.000000000 +0100@@ -58,8 +58,8 @@ static void Close( vlc_object_t * );  vlc_module_begin();-    set_shortname( _("UDP/RTP" ) );-    set_description( _("UDP/RTP input") );+    set_shortname( _("UDP-Lite/RTP" ) );+    set_description( _("UDP-Lite/RTP input") );     set_category( CAT_INPUT );     set_subcategory( SUBCAT_INPUT_ACCESS ); @@ -550,7 +550,7 @@      if( p_block->p_buffer[0] == 0x47 )     {-        msg_Dbg( p_access, "detected TS over raw UDP" );+        msg_Dbg( p_access, "detected TS over raw UDP-Lite" );         p_access->pf_block = BlockUDP;         p_access->info.b_prebuffered = VLC_TRUE;         return p_block;--- vlc-0.8.5/modules/gui/wxwidgets/dialogs/streamout.cpp	2006-05-06 16:52:17.000000000 +0100+++ vlc-0.8.5UDP-Lite/modules/gui/wxwidgets/dialogs/streamout.cpp	2006-07-25 16:45:42.000000000 +0100@@ -473,7 +473,7 @@         wxU(_("HTTP")),         wxU(_("MMSH")),         wxU(_("RTP")),-        wxU(_("UDP")),+        wxU(_("UDP-Lite")),     };      for( i=0; i < ACCESS_OUT_NUM; i++ )

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -