*psz_crl = NULL;
int i_port = 0;
char *psz_src;
- char psz_tmp[10];
- var_Create(p_intf->p_libvlc, "http-host", VLC_VAR_STRING );
- psz_address=var_GetString(p_intf->p_libvlc, "http-host");
+ var_Create(p_intf->p_libvlc_global, "http-host", VLC_VAR_STRING );
+ psz_address=var_GetString(p_intf->p_libvlc_global, "http-host");
if( !psz_address || !*psz_address )
{
psz_address = config_GetPsz( p_intf, "http-host" );
i_port= 8080;
}
- /* Ugly hack to allow to run several HTTP servers on different ports. */
- sprintf( psz_tmp, "%s:%d", psz_address, i_port + 1 );
- var_SetString( p_intf->p_libvlc, "http-host", psz_tmp );
-
msg_Dbg( p_intf, "base %s:%d", psz_address, i_port );
p_sys->p_httpd_host = httpd_TLSHostNew( VLC_OBJECT(p_intf), psz_address,
free( p_sys );
return VLC_EGENERIC;
}
+ else
+ {
+ char psz_tmp[NI_MAXHOST + 6];
+
+ /* Ugly hack to run several HTTP servers on different ports */
+ snprintf( psz_tmp, sizeof (psz_tmp), "%s:%d", psz_address, i_port + 1 );
+ var_SetString( p_intf->p_libvlc_global, "http-host", psz_tmp );
+ }
p_sys->i_files = 0;
p_sys->pp_files = NULL;
#if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32)
if ( ( psz_src = config_GetPsz( p_intf, "http-src" )) == NULL )
{
- char * psz_vlcpath = p_intf->p_libvlc->psz_vlcpath;
+ char * psz_vlcpath = p_intf->p_libvlc_global->psz_vlcpath;
psz_src = malloc( strlen(psz_vlcpath) + strlen("/share/http" ) + 1 );
if( !psz_src ) return VLC_ENOMEM;
#if defined(WIN32)
{
intf_sys_t *p_sys = p_intf->p_sys;
- while( !p_intf->b_die )
+ while( !intf_ShouldDie( p_intf ) )
{
/* get the playlist */
if( p_sys->p_playlist == NULL )
var_Get( p_sys->p_input, "position", &val);
sprintf( position, "%d" , (int)((val.f_float) * 100.0));
var_Get( p_sys->p_input, "time", &val);
- sprintf( time, "%d" , (int)(val.i_time / 1000000) );
+ sprintf( time, I64Fi, val.i_time / 1000000LL );
var_Get( p_sys->p_input, "length", &val);
- sprintf( length, "%d" , (int)(val.i_time / 1000000) );
+ sprintf( length, I64Fi, val.i_time / 1000000LL );
var_Get( p_sys->p_input, "state", &val );
if( val.i_int == PLAYING_S )
#define p_sys p_args->p_intf->p_sys
if( p_sys->p_input )
{
- input_item_t *p_item = p_sys->p_input->input.p_item;
+ input_item_t *p_item = input_GetItem( p_sys->p_input );
if( p_item )
{
vlc_mutex_lock( &p_item->p_stats->lock );
char **pp_data = (char **)_pp_data;
FILE *f;
- /* FIXME: do we need character encoding translation here? */
- if( ( f = fopen( p_args->file, "r" ) ) == NULL )
+ if( ( f = utf8_fopen( p_args->file, "r" ) ) == NULL )
{
Callback404( p_args, pp_data, pi_data );
return VLC_SUCCESS;