This could trigger some interface bugs, especially if they handle their callbacks carelessly. Revert if you have issues, but also consider to fix your interface.
vlc_meta_t *p_meta = vlc_meta_New();
access_Control( p_input->p->input.p_access,ACCESS_GET_META, p_meta );
InputUpdateMeta( p_input, p_meta );
vlc_meta_t *p_meta = vlc_meta_New();
access_Control( p_input->p->input.p_access,ACCESS_GET_META, p_meta );
InputUpdateMeta( p_input, p_meta );
- var_SetInteger( libvlc_priv (p_input->p_libvlc)->p_playlist,
- "item-change", p_input->p->input.p_item->i_id );
p_access->info.i_update &= ~INPUT_UPDATE_META;
}
p_access->info.i_update &= ~INPUT_UPDATE_META;
}
+/*****************************************************************************
+ * An input item's meta has changed (Event Callback)
+ *****************************************************************************/
+static void input_item_meta_changed( const vlc_event_t * p_event,
+ void * user_data )
+{
+ playlist_item_t * p_item = user_data;
+ var_SetInteger( p_item->p_playlist,
+ "item-change", p_item->i_id );
+}
+
/*****************************************************************************
* Listen to vlc_InputItemAddSubItem event
*****************************************************************************/
/*****************************************************************************
* Listen to vlc_InputItemAddSubItem event
*****************************************************************************/
vlc_InputItemSubItemAdded,
input_item_subitem_added,
p_item );
vlc_InputItemSubItemAdded,
input_item_subitem_added,
p_item );
+ vlc_event_attach( &p_item->p_input->event_manager,
+ vlc_InputItemMetaChanged,
+ input_item_meta_changed,
+ p_item );
}
static void uninstall_input_item_observer( playlist_item_t * p_item )
{
}
static void uninstall_input_item_observer( playlist_item_t * p_item )
{
+ vlc_event_detach( &p_item->p_input->event_manager,
+ vlc_InputItemMetaChanged,
+ input_item_meta_changed,
+ p_item );
vlc_event_detach( &p_item->p_input->event_manager,
vlc_InputItemSubItemAdded,
input_item_subitem_added,
p_item );
vlc_event_detach( &p_item->p_input->event_manager,
vlc_InputItemSubItemAdded,
input_item_subitem_added,
p_item );
}
/*****************************************************************************
}
/*****************************************************************************