Commit 3d0d4248 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Events: simple code cosmetics change

parent fc49657a
......@@ -226,31 +226,31 @@ bool EventObj::remove(const NPString &name, NPObject *listener, bool bubble)
void EventObj::hook_manager( libvlc_event_manager_t *em, void *userdata )
{
if( !em )
return;
_em = em;
if( _em )
/* attach all libvlc events we need */
for( size_t i = 0; i < ARRAY_SIZE(vlcevents); i++ )
{
/* attach all libvlc events we care about */
for( size_t i = 0; i < ARRAY_SIZE(vlcevents); i++ )
{
libvlc_event_attach( _em, vlcevents[i].libvlc_type,
vlcevents[i].libvlc_callback,
userdata );
}
libvlc_event_attach( _em, vlcevents[i].libvlc_type,
vlcevents[i].libvlc_callback,
userdata );
}
}
void EventObj::unhook_manager( void *userdata )
{
if( _em )
if( !_em )
return;
/* detach all libvlc events */
for( size_t i = 0; i < ARRAY_SIZE(vlcevents); i++ )
{
/* detach all libvlc events we cared about */
for( size_t i = 0; i < ARRAY_SIZE(vlcevents); i++ )
{
libvlc_event_detach( _em, vlcevents[i].libvlc_type,
vlcevents[i].libvlc_callback,
userdata );
}
libvlc_event_detach( _em, vlcevents[i].libvlc_type,
vlcevents[i].libvlc_callback,
userdata );
}
}
......
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