/** Local counter reset each time it is transferred to stats */
int64_t i_sent_bytes;
- char *psz_name;
+ char *psz_path;
sout_access_out_sys_t *p_sys;
int (*pf_seek)( sout_access_out_t *, off_t );
int (*pf_read)( sout_access_out_t *, block_t * );
sout_instance_t *p_sout;
};
-VLC_EXPORT( sout_access_out_t *,sout_AccessOutNew, ( sout_instance_t *, char *psz_access, char *psz_name ) );
+VLC_EXPORT( sout_access_out_t *,sout_AccessOutNew, ( sout_instance_t *, const char *psz_access, const char *psz_name ) );
VLC_EXPORT( void, sout_AccessOutDelete, ( sout_access_out_t * ) );
VLC_EXPORT( int, sout_AccessOutSeek, ( sout_access_out_t *, off_t ) );
VLC_EXPORT( int, sout_AccessOutRead, ( sout_access_out_t *, block_t * ) );
/* Init p_access */
p_sys->fd_data = -1;
- if( parseURL( &p_sys->url, p_access->psz_name ) )
+ if( parseURL( &p_sys->url, p_access->psz_path ) )
goto exit_error;
if( Connect( p_this, p_sys ) )
config_ChainParse( p_access, SOUT_CFG_PREFIX, ppsz_sout_options, p_access->p_cfg );
- if( !p_access->psz_name )
+ if( !p_access->psz_path )
{
msg_Err( p_access, "no file name specified" );
return VLC_EGENERIC;
var_Get( p_access, SOUT_CFG_PREFIX "append", &val );
i_flags |= val.b_bool ? O_APPEND : O_TRUNC;
- if( !strcmp( p_access->psz_name, "-" ) )
+ if( !strcmp( p_access->psz_path, "-" ) )
{
#if defined(WIN32)
setmode (STDOUT_FILENO, O_BINARY);
else
{
int fd;
- char *psz_tmp = str_format( p_access, p_access->psz_name );
+ char *psz_tmp = str_format( p_access, p_access->psz_path );
path_sanitize( psz_tmp );
fd = utf8_open( psz_tmp, i_flags, 0666 );
if( fd == -1 )
{
- msg_Err( p_access, "cannot open `%s' (%s)", p_access->psz_name,
+ msg_Err( p_access, "cannot open `%s' (%s)", p_access->psz_path,
strerror( errno ) );
free( p_access->p_sys );
return( VLC_EGENERIC );
p_access->pf_read = Read;
p_access->pf_seek = Seek;
- msg_Dbg( p_access, "file access output opened (`%s')", p_access->psz_name );
+ msg_Dbg( p_access, "file access output opened (`%s')", p_access->psz_path );
/* Update pace control flag */
if( p_access->psz_access && !strcmp( p_access->psz_access, "stream" ) )
{
sout_access_out_t *p_access = (sout_access_out_t*)p_this;
- if( strcmp( p_access->psz_name, "-" ) )
+ if( strcmp( p_access->psz_path, "-" ) )
{
if( p_access->p_sys->i_handle )
{
*****************************************************************************/
static int Read( sout_access_out_t *p_access, block_t *p_buffer )
{
- if( strcmp( p_access->psz_name, "-" ) )
+ if( strcmp( p_access->psz_path, "-" ) )
{
return read( p_access->p_sys->i_handle, p_buffer->p_buffer,
p_buffer->i_buffer );
*****************************************************************************/
static int Seek( sout_access_out_t *p_access, off_t i_pos )
{
- if( strcmp( p_access->psz_name, "-" ) )
+ if( strcmp( p_access->psz_path, "-" ) )
{
#if defined( WIN32 ) && !defined( UNDER_CE )
return( _lseeki64( p_access->p_sys->i_handle, i_pos, SEEK_SET ) );
config_ChainParse( p_access, SOUT_CFG_PREFIX, ppsz_sout_options, p_access->p_cfg );
- /* p_access->psz_name = "hostname:port/filename" */
- psz_bind_addr = psz_parser = strdup( p_access->psz_name );
+ /* p_access->psz_path = "hostname:port/filename" */
+ psz_bind_addr = psz_parser = strdup( p_access->psz_path );
i_bind_port = 0;
psz_file_name = NULL;
if (p_sys->b_rtpts)
cscov += RTP_HEADER_LENGTH;
- psz_parser = strdup( p_access->psz_name );
+ psz_parser = strdup( p_access->psz_path );
psz_dst_addr = psz_parser;
i_dst_port = 0;
/* Find the requested muxer */
file_oformat =
- guess_format(NULL, p_mux->p_access->psz_name, NULL);
+ guess_format(NULL, p_mux->p_access->psz_path, NULL);
if (!file_oformat)
{
msg_Err( p_mux, "unable for find a suitable output format" );
p_grab->p_sout = p_sout;
p_grab->psz_access = strdup( "grab" );
p_grab->p_cfg = NULL;
- p_grab->psz_name = strdup( "" );
+ p_grab->psz_path = strdup( "" );
p_grab->p_sys = (sout_access_out_sys_t*)p_stream;
p_grab->pf_seek = NULL;
p_grab->pf_write = AccessOutGrabberWrite;
#if 0
p_session->psz_uri = strdup( url.psz_host );
p_session->i_port = url.i_port;
- p_session->psz_sdp = NULL;
p_session->i_payload = 33;
p_session->b_rtp = strstr( psz_access, "rtp") ? 1 : 0;
#endif
* sout_AccessOutNew: allocate a new access out
*****************************************************************************/
sout_access_out_t *sout_AccessOutNew( sout_instance_t *p_sout,
- char *psz_access, char *psz_name )
+ const char *psz_access, const char *psz_name )
{
sout_access_out_t *p_access;
char *psz_next;
{
free( psz_next );
}
- p_access->psz_name = strdup( psz_name ? psz_name : "" );
+ p_access->psz_path = strdup( psz_name ? psz_name : "" );
p_access->p_sout = p_sout;
p_access->p_sys = NULL;
p_access->pf_seek = NULL;
if( !p_access->p_module )
{
free( p_access->psz_access );
- free( p_access->psz_name );
+ free( p_access->psz_path );
vlc_object_detach( p_access );
vlc_object_destroy( p_access );
return( NULL );
config_ChainDestroy( p_access->p_cfg );
- free( p_access->psz_name );
+ free( p_access->psz_path );
vlc_object_destroy( p_access );
}