]> git.sesse.net Git - vlc/blobdiff - modules/access/tcp.c
Fix misleading comment
[vlc] / modules / access / tcp.c
index fcb623db08e49e9461d9a44982bb3122c24dc2f9..6b3a0a7111345dee316b82ad97f8c1eb6d46736b 100644 (file)
  * Preamble
  *****************************************************************************/
 
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_access.h>
 
 #include <vlc_network.h>
@@ -42,15 +47,15 @@ static int  Open ( vlc_object_t * );
 static void Close( vlc_object_t * );
 
 vlc_module_begin();
-    set_shortname( _("TCP") );
-    set_description( _("TCP input") );
+    set_shortname( N_("TCP") );
+    set_description( N_("TCP input") );
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_ACCESS );
 
     add_integer( "tcp-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT,
-                 CACHING_LONGTEXT, VLC_TRUE );
+                 CACHING_LONGTEXT, true );
 
-    set_capability( "access2", 0 );
+    set_capability( "access", 0 );
     add_shortcut( "tcp" );
     set_callbacks( Open, Close );
 vlc_module_end();
@@ -64,7 +69,7 @@ struct access_sys_t
 };
 
 
-static int Read( access_t *, uint8_t *, int );
+static ssize_t Read( access_t *, uint8_t *, size_t );
 static int Control( access_t *, int, va_list );
 
 /*****************************************************************************
@@ -130,9 +135,9 @@ static void Close( vlc_object_t *p_this )
 }
 
 /*****************************************************************************
- * Read: read on a file descriptor, checking b_die periodically
+ * Read: read on a file descriptor
  *****************************************************************************/
-static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
+static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
 {
     access_sys_t *p_sys = p_access->p_sys;
     int i_read;
@@ -141,9 +146,9 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
         return 0;
 
     i_read = net_Read( p_access, p_sys->fd, NULL, p_buffer, i_len,
-                       VLC_FALSE );
+                       false );
     if( i_read == 0 )
-        p_access->info.b_eof = VLC_TRUE;
+        p_access->info.b_eof = true;
     else if( i_read > 0 )
         p_access->info.i_pos += i_read;
 
@@ -155,7 +160,7 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
  *****************************************************************************/
 static int Control( access_t *p_access, int i_query, va_list args )
 {
-    vlc_bool_t   *pb_bool;
+    bool   *pb_bool;
     int          *pi_int;
     int64_t      *pi_64;
 
@@ -164,16 +169,16 @@ static int Control( access_t *p_access, int i_query, va_list args )
         /* */
         case ACCESS_CAN_SEEK:
         case ACCESS_CAN_FASTSEEK:
-            pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t* );
-            *pb_bool = VLC_FALSE;
+            pb_bool = (bool*)va_arg( args, bool* );
+            *pb_bool = false;
             break;
         case ACCESS_CAN_PAUSE:
-            pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t* );
-            *pb_bool = VLC_TRUE;    /* FIXME */
+            pb_bool = (bool*)va_arg( args, bool* );
+            *pb_bool = true;    /* FIXME */
             break;
         case ACCESS_CAN_CONTROL_PACE:
-            pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t* );
-            *pb_bool = VLC_TRUE;    /* FIXME */
+            pb_bool = (bool*)va_arg( args, bool* );
+            *pb_bool = true;    /* FIXME */
             break;
 
         /* */
@@ -184,7 +189,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
 
         case ACCESS_GET_PTS_DELAY:
             pi_64 = (int64_t*)va_arg( args, int64_t * );
-            *pi_64 = (int64_t)var_GetInteger( p_access, "tcp-caching" ) * I64C(1000);
+            *pi_64 = (int64_t)var_GetInteger( p_access, "tcp-caching" ) * INT64_C(1000);
             break;
 
         /* */
@@ -196,6 +201,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
         case ACCESS_SET_TITLE:
         case ACCESS_SET_SEEKPOINT:
         case ACCESS_SET_PRIVATE_ID_STATE:
+        case ACCESS_GET_CONTENT_TYPE:
             return VLC_EGENERIC;
 
         default: