]> git.sesse.net Git - vlc/blobdiff - modules/access_output/file.c
Fix rtmp access_output building
[vlc] / modules / access_output / file.c
index 7d14ca3bffd83a03f0f0c4ab944e230cb3ec4a86..660070947fd115b2289240ba37d34d2eb7d97114 100644 (file)
  *****************************************************************************/
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <string.h>
 #include <time.h>
 #include <fcntl.h>
 #include <errno.h>
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
+#include <vlc_plugin.h>
 #include <vlc_sout.h>
 #include <vlc_block.h>
 #include <vlc_charset.h>
@@ -64,15 +68,15 @@ static void Close( vlc_object_t * );
                             "of replacing it.")
 
 vlc_module_begin();
-    set_description( _("File stream output") );
-    set_shortname( _("File" ));
+    set_description( N_("File stream output") );
+    set_shortname( N_("File" ));
     set_capability( "sout access", 50 );
     set_category( CAT_SOUT );
     set_subcategory( SUBCAT_SOUT_ACO );
     add_shortcut( "file" );
     add_shortcut( "stream" );
     add_bool( SOUT_CFG_PREFIX "append", 0, NULL, APPEND_TEXT,APPEND_LONGTEXT,
-              VLC_TRUE );
+              true );
     set_callbacks( Open, Close );
 vlc_module_end();
 
@@ -84,9 +88,9 @@ static const char *ppsz_sout_options[] = {
     "append", NULL
 };
 
-static int Write( sout_access_out_t *, block_t * );
+static ssize_t Write( sout_access_out_t *, block_t * );
 static int Seek ( sout_access_out_t *, off_t  );
-static int Read ( sout_access_out_t *, block_t * );
+static ssize_t Read ( sout_access_out_t *, block_t * );
 
 struct sout_access_out_sys_t
 {
@@ -139,8 +143,7 @@ static int Open( vlc_object_t *p_this )
 
         if( fd == -1 )
         {
-            msg_Err( p_access, "cannot open `%s' (%s)", p_access->psz_path,
-                     strerror( errno ) );
+            msg_Err( p_access, "cannot open `%s' (%m)", p_access->psz_path );
             free( p_access->p_sys );
             return( VLC_EGENERIC );
         }
@@ -186,7 +189,7 @@ static void Close( vlc_object_t * p_this )
 /*****************************************************************************
  * Read: standard read on a file descriptor.
  *****************************************************************************/
-static int Read( sout_access_out_t *p_access, block_t *p_buffer )
+static ssize_t Read( sout_access_out_t *p_access, block_t *p_buffer )
 {
     if( strcmp( p_access->psz_path, "-" ) )
     {
@@ -201,7 +204,7 @@ static int Read( sout_access_out_t *p_access, block_t *p_buffer )
 /*****************************************************************************
  * Write: standard write on a file descriptor.
  *****************************************************************************/
-static int Write( sout_access_out_t *p_access, block_t *p_buffer )
+static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
 {
     size_t i_write = 0;