va_list args;
/* does caller care about exceptions ? */
- if( p_exception == NULL )
- return;
+ if( p_exception == NULL ) return;
/* remove previous exception if it wasn't cleared */
if( p_exception->b_raised && p_exception->psz_message )
{
- free(p_exception->psz_message);
- p_exception->psz_message = NULL;
+ free(p_exception->psz_message);
+ p_exception->psz_message = NULL;
}
va_start( args, psz_format );
}
libvlc_instance_t * libvlc_new( int argc, char **argv,
- libvlc_exception_t *p_exception )
+ libvlc_exception_t *p_e )
{
int i_vlc_id;
libvlc_instance_t *p_new;
i_vlc_id = VLC_Create();
p_vlc = (vlc_t* ) vlc_current_object( i_vlc_id );
- if( !p_vlc )
- {
- libvlc_exception_raise( p_exception, "VLC initialization failed" );
- return NULL;
- }
+ if( !p_vlc ) RAISENULL( "VLC initialization failed" );
+
p_new = (libvlc_instance_t *)malloc( sizeof( libvlc_instance_t ) );
+ if( !p_new ) RAISENULL( "Out of memory" );
/** \todo Look for interface settings. If we don't have any, add -I dummy */
/* Because we probably don't want a GUI by default */
- if( !p_new )
- {
- libvlc_exception_raise( p_exception, "Out of memory" );
- return NULL;
- }
VLC_Init( i_vlc_id, argc, argv );
VLC_OBJECT_PLAYLIST, FIND_CHILD );
p_new->p_vlm = NULL;
- if( !p_new->p_playlist )
- {
- libvlc_exception_raise( p_exception, "Playlist creation failed" );
- return NULL;
- }
+ if( !p_new->p_playlist ) RAISENULL( "Playlist creation failed" );
+
p_new->i_vlc_id = i_vlc_id;
-
return p_new;
}
{
return p_instance->i_vlc_id;
}
-