Commit 61ee17a8 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

playlist: Listen to duration changed events, and remove a vout->playlist dependency.

parent 9ff2a688
...@@ -2162,14 +2162,6 @@ static int UpdateFromAccess( input_thread_t *p_input ) ...@@ -2162,14 +2162,6 @@ static int UpdateFromAccess( input_thread_t *p_input )
static void UpdateItemLength( input_thread_t *p_input, int64_t i_length ) static void UpdateItemLength( input_thread_t *p_input, int64_t i_length )
{ {
input_item_SetDuration( p_input->p->input.p_item, (mtime_t) i_length ); input_item_SetDuration( p_input->p->input.p_item, (mtime_t) i_length );
if( !p_input->b_preparsing )
{
pl_Yield( p_input );
var_SetInteger( libvlc_priv (p_input->p_libvlc)->p_playlist,
"item-change", p_input->p->input.p_item->i_id );
pl_Release( p_input );
}
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -107,9 +107,9 @@ static void input_item_subitem_added( const vlc_event_t * p_event, ...@@ -107,9 +107,9 @@ static void input_item_subitem_added( const vlc_event_t * p_event,
} }
/***************************************************************************** /*****************************************************************************
* An input item's meta has changed (Event Callback) * An input item's meta or duration has changed (Event Callback)
*****************************************************************************/ *****************************************************************************/
static void input_item_meta_changed( const vlc_event_t * p_event, static void input_item_changed( const vlc_event_t * p_event,
void * user_data ) void * user_data )
{ {
playlist_item_t * p_item = user_data; playlist_item_t * p_item = user_data;
...@@ -126,6 +126,10 @@ static void install_input_item_observer( playlist_item_t * p_item ) ...@@ -126,6 +126,10 @@ static void install_input_item_observer( playlist_item_t * p_item )
vlc_InputItemSubItemAdded, vlc_InputItemSubItemAdded,
input_item_subitem_added, input_item_subitem_added,
p_item ); p_item );
vlc_event_attach( &p_item->p_input->event_manager,
vlc_InputItemDurationChanged,
input_item_meta_changed,
p_item );
vlc_event_attach( &p_item->p_input->event_manager, vlc_event_attach( &p_item->p_input->event_manager,
vlc_InputItemMetaChanged, vlc_InputItemMetaChanged,
input_item_meta_changed, input_item_meta_changed,
...@@ -138,6 +142,10 @@ static void uninstall_input_item_observer( playlist_item_t * p_item ) ...@@ -138,6 +142,10 @@ static void uninstall_input_item_observer( playlist_item_t * p_item )
vlc_InputItemMetaChanged, vlc_InputItemMetaChanged,
input_item_meta_changed, input_item_meta_changed,
p_item ); p_item );
vlc_event_detach( &p_item->p_input->event_manager,
vlc_InputItemDurationChanged,
input_item_meta_changed,
p_item );
vlc_event_detach( &p_item->p_input->event_manager, vlc_event_detach( &p_item->p_input->event_manager,
vlc_InputItemSubItemAdded, vlc_InputItemSubItemAdded,
input_item_subitem_added, input_item_subitem_added,
......
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