Commit 3c5f6d9e authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

playlist: Listen to vlc_InputSelectedStreamChanged events.

parent e9fba763
...@@ -211,6 +211,17 @@ static void input_state_changed( const vlc_event_t * event, void * data ) ...@@ -211,6 +211,17 @@ static void input_state_changed( const vlc_event_t * event, void * data )
playlist_Signal( p_playlist ); playlist_Signal( p_playlist );
} }
/* Input Callback */
static void input_selected_stream_changed( const vlc_event_t * event, void * data )
{
(void)event;
playlist_t * p_playlist = data;
PL_LOCK;
p_playlist->gc_date = mdate();
vlc_object_signal_unlocked( p_playlist );
PL_UNLOCK;
}
/* Internals */ /* Internals */
void playlist_release_current_input( playlist_t * p_playlist ) void playlist_release_current_input( playlist_t * p_playlist )
{ {
...@@ -223,6 +234,8 @@ void playlist_release_current_input( playlist_t * p_playlist ) ...@@ -223,6 +234,8 @@ void playlist_release_current_input( playlist_t * p_playlist )
vlc_event_detach( p_em, vlc_InputStateChanged, vlc_event_detach( p_em, vlc_InputStateChanged,
input_state_changed, p_playlist ); input_state_changed, p_playlist );
vlc_event_detach( p_em, vlc_InputSelectedStreamChanged,
input_selected_stream_changed, p_playlist );
p_playlist->p_input = NULL; p_playlist->p_input = NULL;
/* Release the playlist lock, because we may get stuck /* Release the playlist lock, because we may get stuck
...@@ -246,6 +259,8 @@ void playlist_set_current_input( ...@@ -246,6 +259,8 @@ void playlist_set_current_input(
vlc_event_manager_t * p_em = input_get_event_manager( p_input ); vlc_event_manager_t * p_em = input_get_event_manager( p_input );
vlc_event_attach( p_em, vlc_InputStateChanged, vlc_event_attach( p_em, vlc_InputStateChanged,
input_state_changed, p_playlist ); input_state_changed, p_playlist );
vlc_event_attach( p_em, vlc_InputSelectedStreamChanged,
input_selected_stream_changed, p_playlist );
} }
} }
......
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