I attached a callback to the playlist's "item-change" event, then call playlist_CurrentInput in the callback. I see that I am wrong, but what am I supposed to do? (In 2.0.X, I attached a callback to "item-current", but vlc_playlist.h appears not to use that as an event variable anymore.)
Code: Select all
void init(...)
{
p_playlist = pl_Get(p_intf);
var_AddCallback( p_playlist, "item-change", PlaylistCbItemChange, NULL );
}
int PlaylistCbItemChange( vlc_object_t *p_this, const char *psz_var, vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
msg_Info( p_this, "input item changed [1] " );
input_thread_t * p = playlist_CurrentInput( p_playlist );
msg_Info( p_this, "input item changed [2] " );
}