}
/*****************************************************************************
- * 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,
- void * user_data )
+static void input_item_changed( const vlc_event_t * p_event,
+ void * user_data )
{
+ (void)p_event;
playlist_item_t * p_item = user_data;
- var_SetInteger( p_item->p_playlist,
- "item-change", p_item->i_id );
+ var_SetInteger( p_item->p_playlist, "item-change", p_item->i_id );
}
/*****************************************************************************
*****************************************************************************/
static void install_input_item_observer( playlist_item_t * p_item )
{
- vlc_event_attach( &p_item->p_input->event_manager,
- 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 );
+ vlc_event_manager_t * p_em = &p_item->p_input->event_manager;
+ vlc_event_attach( p_em, vlc_InputItemSubItemAdded,
+ input_item_subitem_added, p_item );
+ vlc_event_attach( p_em, vlc_InputItemDurationChanged,
+ input_item_changed, p_item );
+ vlc_event_attach( p_em, vlc_InputItemMetaChanged,
+ input_item_changed, p_item );
+ vlc_event_attach( p_em, vlc_InputItemNameChanged,
+ input_item_changed, p_item );
+ vlc_event_attach( p_em, vlc_InputItemInfoChanged,
+ input_item_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 );
+ vlc_event_manager_t * p_em = &p_item->p_input->event_manager;
+ vlc_event_detach( p_em, vlc_InputItemSubItemAdded,
+ input_item_subitem_added, p_item );
+ vlc_event_detach( p_em, vlc_InputItemMetaChanged,
+ input_item_changed, p_item );
+ vlc_event_detach( p_em, vlc_InputItemDurationChanged,
+ input_item_changed, p_item );
+ vlc_event_detach( p_em, vlc_InputItemNameChanged,
+ input_item_changed, p_item );
+ vlc_event_detach( p_em, vlc_InputItemInfoChanged,
+ input_item_changed, p_item );
}
/*****************************************************************************
i_ret = playlist_AddInput( p_playlist, p_input, i_mode, i_pos, b_playlist,
b_locked );
- int i_id = i_ret == VLC_SUCCESS ? p_input->i_id : -1;
+ int i_id = (i_ret == VLC_SUCCESS) ? p_input->i_id : -1;
vlc_gc_decref( p_input );
p_playlist->p_root_onelevel, false );
}
p_playlist->b_reset_currently_playing = true;
- vlc_cond_signal( &p_playlist->object_wait );
+ vlc_object_signal_unlocked( p_playlist );
var_SetInteger( p_playlist, "item-change", p_item_in_category->
p_input->i_id );
if( !b_locked ) PL_UNLOCK;
else
i_ret = TreeMove( p_playlist, p_item, p_node, i_newpos );
p_playlist->b_reset_currently_playing = true;
- vlc_cond_signal( &p_playlist->object_wait );
+ vlc_object_signal_maybe( VLC_OBJECT(p_playlist) );
return i_ret;
}
val.p_address = p_add;
p_playlist->b_reset_currently_playing = true;
if( b_signal )
- vlc_cond_signal( &p_playlist->object_wait );
+ vlc_object_signal_maybe( p_playlist );
var_Set( p_playlist, "item-append", val );
free( p_add );
}
if( p_playlist->p_input )
input_StopThread( p_playlist->p_input );
p_playlist->request.i_status = PLAYLIST_RUNNING;
- vlc_cond_signal( &p_playlist->object_wait );
+ vlc_object_signal_maybe( VLC_OBJECT(p_playlist) );
}
/* Preparse if PREPARSE or SPREPARSE & not enough meta */
char *psz_artist = input_item_GetArtist( p_item_cat->p_input );
p_playlist->request.b_request = true;
p_playlist->request.p_item = NULL;
msg_Info( p_playlist, "stopping playback" );
- vlc_cond_signal( &p_playlist->object_wait );
+ vlc_object_signal_maybe( VLC_OBJECT(p_playlist) );
}
b_delay_deletion = true;
}