Commit 7f4edacf authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

event: remove unused instance libvlc_event_manager_new() parameter

parent 475d6019
...@@ -68,7 +68,7 @@ group_contains_listener( libvlc_event_listeners_group_t * group, ...@@ -68,7 +68,7 @@ group_contains_listener( libvlc_event_listeners_group_t * group,
* Init an object's event manager. * Init an object's event manager.
**************************************************************************/ **************************************************************************/
libvlc_event_manager_t * libvlc_event_manager_t *
libvlc_event_manager_new( void * p_obj, libvlc_instance_t * p_libvlc_inst ) libvlc_event_manager_new( void * p_obj )
{ {
libvlc_event_manager_t * p_em; libvlc_event_manager_t * p_em;
...@@ -81,9 +81,7 @@ libvlc_event_manager_new( void * p_obj, libvlc_instance_t * p_libvlc_inst ) ...@@ -81,9 +81,7 @@ libvlc_event_manager_new( void * p_obj, libvlc_instance_t * p_libvlc_inst )
p_em->p_obj = p_obj; p_em->p_obj = p_obj;
p_em->async_event_queue = NULL; p_em->async_event_queue = NULL;
p_em->p_libvlc_instance = p_libvlc_inst;
libvlc_retain( p_libvlc_inst );
vlc_array_init( &p_em->listeners_groups ); vlc_array_init( &p_em->listeners_groups );
vlc_mutex_init( &p_em->object_lock ); vlc_mutex_init( &p_em->object_lock );
vlc_mutex_init_recursive( &p_em->event_sending_lock ); vlc_mutex_init_recursive( &p_em->event_sending_lock );
...@@ -116,7 +114,6 @@ void libvlc_event_manager_release( libvlc_event_manager_t * p_em ) ...@@ -116,7 +114,6 @@ void libvlc_event_manager_release( libvlc_event_manager_t * p_em )
free( p_lg ); free( p_lg );
} }
vlc_array_clear( &p_em->listeners_groups ); vlc_array_clear( &p_em->listeners_groups );
libvlc_release( p_em->p_libvlc_instance );
free( p_em ); free( p_em );
} }
......
...@@ -52,8 +52,7 @@ ...@@ -52,8 +52,7 @@
* libvlc_my_cool_object_new() * libvlc_my_cool_object_new()
* { * {
* ... * ...
* p_self->p_event_manager = libvlc_event_manager_new( p_self, * p_self->p_event_manager = libvlc_event_manager_new( p_self )
* p_self->p_libvlc_instance, p_e);
* libvlc_event_manager_register_event_type(p_self->p_event_manager, * libvlc_event_manager_register_event_type(p_self->p_event_manager,
* libvlc_MyCoolObjectDidSomething, p_e) * libvlc_MyCoolObjectDidSomething, p_e)
* ... * ...
...@@ -87,7 +86,6 @@ typedef struct libvlc_event_listener_t ...@@ -87,7 +86,6 @@ typedef struct libvlc_event_listener_t
typedef struct libvlc_event_manager_t typedef struct libvlc_event_manager_t
{ {
void * p_obj; void * p_obj;
struct libvlc_instance_t * p_libvlc_instance;
vlc_array_t listeners_groups; vlc_array_t listeners_groups;
vlc_mutex_t object_lock; vlc_mutex_t object_lock;
vlc_mutex_t event_sending_lock; vlc_mutex_t event_sending_lock;
......
...@@ -90,8 +90,7 @@ void libvlc_threads_init (void); ...@@ -90,8 +90,7 @@ void libvlc_threads_init (void);
void libvlc_threads_deinit (void); void libvlc_threads_deinit (void);
/* Events */ /* Events */
libvlc_event_manager_t * libvlc_event_manager_new( libvlc_event_manager_t * libvlc_event_manager_new(void * p_obj);
void * p_obj, libvlc_instance_t * p_libvlc_inst );
void libvlc_event_manager_release( void libvlc_event_manager_release(
libvlc_event_manager_t * p_em ); libvlc_event_manager_t * p_em );
......
...@@ -355,7 +355,7 @@ libvlc_media_t * libvlc_media_new_from_input_item( ...@@ -355,7 +355,7 @@ libvlc_media_t * libvlc_media_new_from_input_item(
* It can give a bunch of item to read. */ * It can give a bunch of item to read. */
p_md->p_subitems = NULL; p_md->p_subitems = NULL;
p_md->p_event_manager = libvlc_event_manager_new( p_md, p_instance ); p_md->p_event_manager = libvlc_event_manager_new( p_md );
if( unlikely(p_md->p_event_manager == NULL) ) if( unlikely(p_md->p_event_manager == NULL) )
{ {
free(p_md); free(p_md);
......
...@@ -210,7 +210,7 @@ libvlc_media_discoverer_new( libvlc_instance_t * p_inst, const char * psz_name ) ...@@ -210,7 +210,7 @@ libvlc_media_discoverer_new( libvlc_instance_t * p_inst, const char * psz_name )
vlc_dictionary_init( &p_mdis->catname_to_submedialist, 0 ); vlc_dictionary_init( &p_mdis->catname_to_submedialist, 0 );
p_mdis->p_event_manager = libvlc_event_manager_new( p_mdis, p_inst ); p_mdis->p_event_manager = libvlc_event_manager_new( p_mdis );
if( unlikely(p_mdis->p_event_manager == NULL) ) if( unlikely(p_mdis->p_event_manager == NULL) )
{ {
free( p_mdis ); free( p_mdis );
......
...@@ -73,7 +73,7 @@ libvlc_media_library_new( libvlc_instance_t * p_inst ) ...@@ -73,7 +73,7 @@ libvlc_media_library_new( libvlc_instance_t * p_inst )
p_mlib->i_refcount = 1; p_mlib->i_refcount = 1;
p_mlib->p_mlist = NULL; p_mlib->p_mlist = NULL;
p_mlib->p_event_manager = libvlc_event_manager_new( p_mlib, p_inst ); p_mlib->p_event_manager = libvlc_event_manager_new( p_mlib );
if( unlikely(p_mlib->p_event_manager == NULL) ) if( unlikely(p_mlib->p_event_manager == NULL) )
{ {
free(p_mlib); free(p_mlib);
......
...@@ -160,7 +160,7 @@ libvlc_media_list_new( libvlc_instance_t * p_inst ) ...@@ -160,7 +160,7 @@ libvlc_media_list_new( libvlc_instance_t * p_inst )
} }
p_mlist->p_libvlc_instance = p_inst; p_mlist->p_libvlc_instance = p_inst;
p_mlist->p_event_manager = libvlc_event_manager_new( p_mlist, p_inst ); p_mlist->p_event_manager = libvlc_event_manager_new( p_mlist );
if( unlikely(p_mlist->p_event_manager == NULL) ) if( unlikely(p_mlist->p_event_manager == NULL) )
{ {
free(p_mlist); free(p_mlist);
......
...@@ -458,7 +458,7 @@ libvlc_media_list_player_new(libvlc_instance_t * p_instance) ...@@ -458,7 +458,7 @@ libvlc_media_list_player_new(libvlc_instance_t * p_instance)
return NULL; return NULL;
} }
p_mlp->p_event_manager = libvlc_event_manager_new(p_mlp, p_instance); p_mlp->p_event_manager = libvlc_event_manager_new(p_mlp);
if (unlikely(p_mlp->p_event_manager == NULL)) if (unlikely(p_mlp->p_event_manager == NULL))
{ {
free (p_mlp); free (p_mlp);
......
...@@ -678,7 +678,7 @@ libvlc_media_player_new( libvlc_instance_t *instance ) ...@@ -678,7 +678,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
vlc_mutex_init (&mp->input.lock); vlc_mutex_init (&mp->input.lock);
mp->i_refcount = 1; mp->i_refcount = 1;
mp->p_event_manager = libvlc_event_manager_new(mp, instance); mp->p_event_manager = libvlc_event_manager_new(mp);
if (unlikely(mp->p_event_manager == NULL)) if (unlikely(mp->p_event_manager == NULL))
{ {
input_resource_Release(mp->input.p_resource); input_resource_Release(mp->input.p_resource);
......
...@@ -125,7 +125,7 @@ static int libvlc_vlm_init( libvlc_instance_t *p_instance ) ...@@ -125,7 +125,7 @@ static int libvlc_vlm_init( libvlc_instance_t *p_instance )
if( !p_instance->libvlc_vlm.p_event_manager ) if( !p_instance->libvlc_vlm.p_event_manager )
{ {
p_instance->libvlc_vlm.p_event_manager = p_instance->libvlc_vlm.p_event_manager =
libvlc_event_manager_new( p_instance->libvlc_vlm.p_vlm, p_instance ); libvlc_event_manager_new( p_instance->libvlc_vlm.p_vlm );
if( unlikely(p_instance->libvlc_vlm.p_event_manager == NULL) ) if( unlikely(p_instance->libvlc_vlm.p_event_manager == NULL) )
return VLC_ENOMEM; return VLC_ENOMEM;
libvlc_event_manager_register_event_type( libvlc_event_manager_register_event_type(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment