Currently libvlc uses "state" callback to notice input state changes, and the playlist notice input state change via direct call from the input.
playlist can't use the "state" variable as it is also used by the playlist to ask the input to do a certain action.
The event approach is much more clear here.
p_input->b_preparsing = b_quick;
p_input->psz_header = psz_header ? strdup( psz_header ) : NULL;
+ /* Init events */
+ vlc_event_manager_init_with_vlc_object(
+ &p_input->p->event_manager, p_input );
+
/* Init Common fields */
p_input->b_eof = false;
p_input->b_can_pace_control = true;
{
input_thread_private_t *priv = p_input->p;
+ vlc_event_manager_fini( &p_input->p->event_manager );
+
stats_TimerDump( p_input, STATS_TIMER_INPUT_LAUNCHING );
stats_TimerClean( p_input, STATS_TIMER_INPUT_LAUNCHING );
#ifdef ENABLE_SOUT
/** Private input fields */
struct input_thread_private_t
{
+ /* Object's event manager */
+ vlc_event_manager_t event_manager;
+
/* Global properties */
bool b_can_pause;
bool b_can_rate_control;