}
void libvlc_exception_raise( libvlc_exception_t *p_exception,
- const char *psz_format, ... )
+ const char *psz_format, ... )
{
va_list args;
char * psz;
p_new->p_callback_list = NULL;
vlc_mutex_init(&p_new->instance_lock);
vlc_mutex_init(&p_new->event_callback_lock);
-
+
libvlc_event_init(p_new, p_e);
return p_new;
#include <vlc/libvlc.h>
#include <vlc_playlist.h>
-
/*
* Private functions
*/
**************************************************************************/
void libvlc_event_init( libvlc_instance_t *p_instance, libvlc_exception_t *p_e )
{
- (void)p_instance;(void)p_e;
+ VLC_UNUSED(p_instance);
+ VLC_UNUSED(p_e);
/* Will certainly be used to install libvlc_instance event */
}
**************************************************************************/
void libvlc_event_fini( libvlc_instance_t *p_instance )
{
- (void)p_instance;
+ VLC_UNUSED(p_instance);
}
/**************************************************************************
continue;
}
}
-
+
listener_cached->pf_callback( p_event, listener_cached->p_user_data );
listener_cached++;
}
EVENT(libvlc_MediaDiscovererEnded)
#undef EVENT
};
+
static const char * unkwown_event_name = "Unknown Event";
const char * libvlc_event_type_name( libvlc_event_type_t event_type )
libvlc_exception_raise( p_e, "No Memory left" );
return;
}
-
+
listener->event_type = event_type;
listener->p_user_data = p_user_data;
listener->pf_callback = pf_callback;
listener->p_user_data == p_user_data )
{
/* that's our listener */
-
+
/* Mark this group as edited so that libvlc_event_send
* will recheck what listener to call */
listeners_group->b_sublistener_removed = false;
}
p_md = malloc( sizeof(libvlc_media_t) );
+ if( !p_md )
+ {
+ libvlc_exception_raise( p_e, "Not enough memory" );
+ return NULL;
+ }
+
p_md->p_libvlc_instance = p_instance;
p_md->p_input_item = p_input_item;
p_md->b_preparsed = false;
/* The p_input_item is retained in libvlc_media_new_from_input_item */
vlc_gc_decref( p_input_item );
-
+
return p_md;
}
const char * ppsz_option,
libvlc_exception_t *p_e )
{
- (void)p_e;
+ VLC_UNUSED(p_e);
input_ItemAddOpt( p_md->p_input_item, ppsz_option,
VLC_INPUT_OPTION_UNIQUE|VLC_INPUT_OPTION_TRUSTED );
}
libvlc_media_get_mrl( libvlc_media_t * p_md,
libvlc_exception_t * p_e )
{
- (void)p_e;
+ VLC_UNUSED(p_e);
return input_item_GetURI( p_md->p_input_item );
}
libvlc_meta_t e_meta,
libvlc_exception_t *p_e )
{
- VLC_UNUSED(p_e);
-
char * psz_meta;
+ VLC_UNUSED(p_e);
/* XXX: locking */
psz_meta = input_item_GetMeta( p_md->p_input_item,
libvlc_to_vlc_meta[e_meta] );
-
+
if( e_meta == libvlc_meta_ArtworkURL && !psz_meta )
{
playlist_AskForArtEnqueue(
libvlc_media_get_state( libvlc_media_t *p_md,
libvlc_exception_t *p_e )
{
- (void)p_e;
+ VLC_UNUSED(p_e);
return p_md->state;
}
libvlc_state_t state,
libvlc_exception_t *p_e )
{
- (void)p_e;
libvlc_event_t event;
+ VLC_UNUSED(p_e);
p_md->state = state;
return NULL;
}
}
-
/* Insert the newly created mlist in our dictionary */
vlc_dictionary_insert( &p_mdis->catname_to_submedialist, psz_cat, p_mlist );
-
+
/* Insert the md into the root list */
libvlc_media_list_lock( p_mdis->p_mlist );
_libvlc_media_list_add_media( p_mdis->p_mlist, p_catmd, NULL );
static void services_discovery_started( const vlc_event_t * p_event,
void * user_data )
{
- (void)p_event;
+ VLC_UNUSED(p_event);
libvlc_media_discoverer_t * p_mdis = user_data;
libvlc_event_t event;
p_mdis->running = true;
static void services_discovery_ended( const vlc_event_t * p_event,
void * user_data )
{
- (void)p_event;
+ VLC_UNUSED(p_event);
libvlc_media_discoverer_t * p_mdis = user_data;
libvlc_event_t event;
p_mdis->running = false;
libvlc_exception_t * p_e )
{
libvlc_media_discoverer_t * p_mdis;
-
+
p_mdis = malloc(sizeof(libvlc_media_discoverer_t));
if( !p_mdis )
{
{
return p_mdis->running;
}
-
{
[INIT_S] = libvlc_Opening,
[OPENING_S] = libvlc_Opening,
- [BUFFERING_S] = libvlc_Buffering,
- [PLAYING_S] = libvlc_Playing,
- [PAUSE_S] = libvlc_Paused,
- [END_S] = libvlc_Ended,
- [ERROR_S] = libvlc_Error,
+ [BUFFERING_S] = libvlc_Buffering,
+ [PLAYING_S] = libvlc_Playing,
+ [PAUSE_S] = libvlc_Paused,
+ [END_S] = libvlc_Ended,
+ [ERROR_S] = libvlc_Error,
};
+
static inline libvlc_state_t vlc_to_libvlc_state( int vlc_state )
{
if( vlc_state < 0 || vlc_state > 6 )
input_thread_t *p_input_thread;
if( !p_mi ) RAISENULL( "Media Instance is NULL" );
-
+
vlc_mutex_lock( &p_mi->object_lock );
if( !p_mi->p_input_thread )
if (!strncmp(psz_cmd, "intf", 4 /* "-change" no need to go further */))
{
input_thread_t * p_input = (input_thread_t *)p_this;
-
+
var_Get( p_input, "state", &val );
if( val.i_int != PLAYING_S )
return VLC_SUCCESS; /* Don't send the position while stopped */
}
p_mi = malloc( sizeof(libvlc_media_player_t) );
+ if( !p_mi )
+ {
+ libvlc_exception_raise( p_e, "Not enough memory" );
+ return NULL;
+ }
p_mi->p_md = NULL;
p_mi->drawable = 0;
p_mi->p_libvlc_instance = p_libvlc_instance;
return;
vlc_mutex_lock( &p_mi->object_lock );
-
+
p_mi->i_refcount--;
if( p_mi->i_refcount > 0 )
release_input_thread( p_mi );
libvlc_event_manager_release( p_mi->p_event_manager );
-
+
libvlc_media_release( p_mi->p_md );
free( p_mi );
libvlc_media_t *p_md,
libvlc_exception_t *p_e )
{
- (void)p_e;
+ VLC_UNUSED(p_e);
if( !p_mi )
return;
libvlc_media_retain( p_md );
p_mi->p_md = p_md;
-
+
/* The policy here is to ignore that we were created using a different
* libvlc_instance, because we don't really care */
p_mi->p_libvlc_instance = p_md->p_libvlc_instance;
libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
{
- (void)p_e;
+ VLC_UNUSED(p_e);
if( !p_mi->p_md )
return NULL;
libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
{
- (void)p_e;
+ VLC_UNUSED(p_e);
return p_mi->p_event_manager;
}
libvlc_exception_clear( p_e );
vlc_mutex_lock( &p_mi->object_lock );
-
+
if( !p_mi->p_md )
{
libvlc_exception_raise( p_e, "no associated media descriptor" );
libvlc_drawable_t drawable,
libvlc_exception_t *p_e )
{
- (void)p_e;
+ VLC_UNUSED(p_e);
p_mi->drawable = drawable;
}
libvlc_drawable_t
libvlc_media_player_get_drawable ( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e )
{
- (void)p_e;
+ VLC_UNUSED(p_e);
return p_mi->drawable;
}