* src/input/input_info.c: small bug fix.
* modules/stream_out/standard.c: fixed memleaks.
* standard.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* standard.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: standard.c,v 1.16 2003/11/21 15:32:08 fenrir Exp $
+ * $Id: standard.c,v 1.17 2004/01/15 23:40:44 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
{
sout_stream_t *p_stream = (sout_stream_t*)p_this;
sout_instance_t *p_sout = p_stream->p_sout;
{
sout_stream_t *p_stream = (sout_stream_t*)p_this;
sout_instance_t *p_sout = p_stream->p_sout;
- sout_stream_sys_t *p_sys = malloc( sizeof( sout_stream_sys_t) );
+ slp_session_t *p_slp = NULL;
+ sap_session_t *p_sap = NULL;
char *psz_mux = sout_cfg_find_value( p_stream->p_cfg, "mux" );
char *psz_access = sout_cfg_find_value( p_stream->p_cfg, "access" );
char *psz_mux = sout_cfg_find_value( p_stream->p_cfg, "mux" );
char *psz_access = sout_cfg_find_value( p_stream->p_cfg, "access" );
char *psz_mux_byext = NULL;
char *psz_mux_byext = NULL;
- p_sys->p_sap = NULL;
- p_sys->p_slp = NULL;
-
msg_Dbg( p_this, "creating `%s/%s://%s'",
psz_access, psz_mux, psz_url );
msg_Dbg( p_this, "creating `%s/%s://%s'",
psz_access, psz_mux, psz_url );
}
msg_Dbg( p_sout , "Creating SAP with IPv%i", atoi(psz_ipv) );
}
msg_Dbg( p_sout , "Creating SAP with IPv%i", atoi(psz_ipv) );
- p_sys->p_sap = sout_SAPNew( p_sout , psz_url ,
+ p_sap = sout_SAPNew( p_sout , psz_url ,
p_sap_cfg->psz_value ? p_sap_cfg->psz_value : psz_url,
atoi(psz_ipv), psz_v6_scope );
p_sap_cfg->psz_value ? p_sap_cfg->psz_value : psz_url,
atoi(psz_ipv), psz_v6_scope );
msg_Err( p_sout,"Unable to initialize SAP. SAP disabled");
}
msg_Err( p_sout,"Unable to initialize SAP. SAP disabled");
}
- p_sys->p_slp = (slp_session_t*)malloc(sizeof(slp_session_t));
- if(!p_sys->p_slp)
+ p_slp = (slp_session_t*)malloc(sizeof(slp_session_t));
+ if(!p_slp)
{
msg_Warn(p_sout,"Out of memory");
{
msg_Warn(p_sout,"Out of memory");
+ if( p_sap ) free( p_sap );
- p_sys->p_slp->psz_url= strdup(psz_url);
- p_sys->p_slp->psz_name = strdup(
+ p_slp->psz_url= strdup(psz_url);
+ p_slp->psz_name = strdup(
p_slp_cfg->psz_value ? p_slp_cfg->psz_value : psz_url);
}
}
p_slp_cfg->psz_value ? p_slp_cfg->psz_value : psz_url);
}
}
/* XXX beurk */
p_sout->i_preheader = __MAX( p_sout->i_preheader, p_mux->i_preheader );
/* XXX beurk */
p_sout->i_preheader = __MAX( p_sout->i_preheader, p_mux->i_preheader );
-
- p_sys->p_mux = p_mux;
-
p_stream->pf_add = Add;
p_stream->pf_del = Del;
p_stream->pf_send = Send;
p_stream->pf_add = Add;
p_stream->pf_del = Del;
p_stream->pf_send = Send;
- p_stream->p_sys = p_sys;
+ p_stream->p_sys = malloc( sizeof( sout_stream_sys_t) );
+ p_stream->p_sys->p_mux = p_mux;
+ p_stream->p_sys->p_slp = p_slp;
+ p_stream->p_sys->p_sap = p_sap;
+
* decoders.
*****************************************************************************
* Copyright (C) 1998-2004 VideoLAN
* decoders.
*****************************************************************************
* Copyright (C) 1998-2004 VideoLAN
- * $Id: input.c,v 1.275 2004/01/10 23:46:39 sigmunau Exp $
+ * $Id: input.c,v 1.276 2004/01/15 23:40:44 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
playlist_item_t *p_item )
{
input_thread_t * p_input; /* thread descriptor */
playlist_item_t *p_item )
{
input_thread_t * p_input; /* thread descriptor */
- input_info_category_t * p_info;
vlc_value_t val;
int i,j;
vlc_value_t val;
int i,j;
p_input->stream.control.i_status = INIT_S;
p_input->stream.control.i_rate = DEFAULT_RATE;
p_input->stream.control.b_mute = 0;
p_input->stream.control.i_status = INIT_S;
p_input->stream.control.i_rate = DEFAULT_RATE;
p_input->stream.control.b_mute = 0;
- p_input->stream.control.b_grayscale = config_GetInt( p_input, "grayscale" );
-
- /* Initialize input info */
- p_input->stream.p_info = malloc( sizeof( input_info_category_t ) );
- if( !p_input->stream.p_info )
- {
- msg_Err( p_input, "No memory!" );
- return NULL;
- }
- p_input->stream.p_info->psz_name = strdup("General") ;
- p_input->stream.p_info->p_info = NULL;
- p_input->stream.p_info->p_next = NULL;
+ p_input->stream.control.b_grayscale = config_GetInt( p_input, "grayscale");
msg_Info( p_input, "playlist item `%s'", p_input->psz_source );
msg_Info( p_input, "playlist item `%s'", p_input->psz_source );
- p_info = input_InfoCategory( p_input, _("General") );
- input_AddInfo( p_info, _("Playlist Item"), p_input->psz_source );
+ /* Initialize input info */
+ p_input->stream.p_info = NULL;
+ p_input->stream.p_info = input_InfoCategory( p_input, _("General") );
+ input_AddInfo( p_input->stream.p_info, _("Playlist Item"),
+ p_input->psz_source );
vlc_object_attach( p_input, p_parent );
/* Create thread and wait for its readiness. */
vlc_object_attach( p_input, p_parent );
/* Create thread and wait for its readiness. */
VLC_THREAD_PRIORITY_INPUT, VLC_TRUE ) )
{
msg_Err( p_input, "cannot create input thread" );
VLC_THREAD_PRIORITY_INPUT, VLC_TRUE ) )
{
msg_Err( p_input, "cannot create input thread" );
+ input_DelInfo( p_input );
free( p_input );
return NULL;
}
free( p_input );
return NULL;
}
/* Tell we're dead */
p_input->b_dead = 1;
/* Tell we're dead */
p_input->b_dead = 1;
+ input_DelInfo( p_input );
+
* input_info.c: Convenient functions to handle the input info structures
*****************************************************************************
* Copyright (C) 1998-2004 VideoLAN
* input_info.c: Convenient functions to handle the input info structures
*****************************************************************************
* Copyright (C) 1998-2004 VideoLAN
- * $Id: input_info.c,v 1.12 2004/01/06 12:02:06 zorglub Exp $
+ * $Id: input_info.c,v 1.13 2004/01/15 23:40:44 gbazin Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
p_category->psz_name = strdup( psz_name );
p_category->p_next = NULL;
p_category->p_info = NULL;
p_category->psz_name = strdup( psz_name );
p_category->p_next = NULL;
p_category->p_info = NULL;
- p_prev->p_next = p_category;
+ if( p_prev ) p_prev->p_next = p_category;