Commit 9ff2a688 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

playlist: Listen to vlc_InputItemMetaChanged. This removes one more playlist->vout dependency.

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.
parent fe1fdaf5
......@@ -2124,8 +2124,6 @@ static int UpdateFromAccess( input_thread_t *p_input )
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;
}
......
......@@ -106,6 +106,17 @@ static void input_item_subitem_added( const vlc_event_t * p_event,
}
/*****************************************************************************
* 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
*****************************************************************************/
......@@ -115,15 +126,22 @@ static void install_input_item_observer( playlist_item_t * 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 )
{
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 );
}
/*****************************************************************************
......
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