static int Open ( vlc_object_t * );
static void Close( vlc_object_t * );
+#define SOUT_CFG_PREFIX "sout-file-"
+#define APPEND_TEXT N_("Append to file")
+#define APPEND_LONGTEXT N_( "Append to file if it exists instead " \
+ "of replacing it.")
+
vlc_module_begin();
- set_description( _("File stream ouput") );
+ set_description( _("File stream output") );
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 );
set_callbacks( Open, Close );
vlc_module_end();
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
+static const char *ppsz_sout_options[] = {
+ "append", NULL
+};
+
static int 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 * );
{
sout_access_out_t *p_access = (sout_access_out_t*)p_this;
int i_flags;
+ vlc_value_t val;
+
+ sout_CfgParse( p_access, SOUT_CFG_PREFIX, ppsz_sout_options, p_access->p_cfg );
if( !( p_access->p_sys = malloc( sizeof( sout_access_out_sys_t ) ) ) )
{
return VLC_EGENERIC;
}
i_flags = O_RDWR|O_CREAT;
- if( sout_cfg_find_value( p_access->p_cfg, "append" ) )
+
+ var_Get( p_access, SOUT_CFG_PREFIX "append", &val );
+ if( val.b_bool )
{
i_flags |= O_APPEND;
}
p_access->pf_seek = Seek;
msg_Dbg( p_access, "file access output opened (`%s')", p_access->psz_name );
+
+ /* Update pace control flag */
+ if( p_access->psz_access && !strcmp( p_access->psz_access, "stream" ) )
+ p_access->p_sout->i_out_pace_nocontrol++;
+
return VLC_SUCCESS;
}
}
free( p_access->p_sys );
+ /* Update pace control flag */
+ if( p_access->psz_access && !strcmp( p_access->psz_access, "stream" ) )
+ p_access->p_sout->i_out_pace_nocontrol--;
+
msg_Dbg( p_access, "file access output closed" );
}