Commit bdcdf970 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

input: merge ABORT and DEAD events

parent baa8b2e1
...@@ -335,8 +335,6 @@ typedef enum input_event_type_e ...@@ -335,8 +335,6 @@ typedef enum input_event_type_e
INPUT_EVENT_STATE, INPUT_EVENT_STATE,
/* b_dead is true */ /* b_dead is true */
INPUT_EVENT_DEAD, INPUT_EVENT_DEAD,
/* a *user* abort has been requested */
INPUT_EVENT_ABORT,
/* "rate" has changed */ /* "rate" has changed */
INPUT_EVENT_RATE, INPUT_EVENT_RATE,
......
...@@ -302,7 +302,7 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd, ...@@ -302,7 +302,7 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd,
set_state( p_mi, libvlc_state, false ); set_state( p_mi, libvlc_state, false );
libvlc_event_send( p_mi->p_event_manager, &event ); libvlc_event_send( p_mi->p_event_manager, &event );
} }
else if( newval.i_int == INPUT_EVENT_ABORT ) else if( newval.i_int == INPUT_EVENT_DEAD )
{ {
libvlc_state_t libvlc_state = libvlc_Stopped; libvlc_state_t libvlc_state = libvlc_Stopped;
event.type = libvlc_MediaPlayerStopped; event.type = libvlc_MediaPlayerStopped;
......
...@@ -893,7 +893,6 @@ static int InputCallback( vlc_object_t *p_this, const char *psz_var, ...@@ -893,7 +893,6 @@ static int InputCallback( vlc_object_t *p_this, const char *psz_var,
switch( newval.i_int ) switch( newval.i_int )
{ {
case INPUT_EVENT_DEAD: case INPUT_EVENT_DEAD:
case INPUT_EVENT_ABORT:
i_state = PLAYBACK_STATE_STOPPED; i_state = PLAYBACK_STATE_STOPPED;
break; break;
case INPUT_EVENT_STATE: case INPUT_EVENT_STATE:
......
...@@ -376,11 +376,6 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var, ...@@ -376,11 +376,6 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
[[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updatePlaybackPosition) withObject:nil waitUntilDone:NO]; [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updatePlaybackPosition) withObject:nil waitUntilDone:NO];
break; break;
case INPUT_EVENT_ABORT:
[[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updateName) withObject: nil waitUntilDone:NO];
[[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updatePlaybackPosition) withObject:nil waitUntilDone:NO];
break;
default: default:
break; break;
} }
......
...@@ -55,10 +55,6 @@ void input_SendEventDead( input_thread_t *p_input ) ...@@ -55,10 +55,6 @@ void input_SendEventDead( input_thread_t *p_input )
Trigger( p_input, INPUT_EVENT_DEAD ); Trigger( p_input, INPUT_EVENT_DEAD );
} }
void input_SendEventAbort( input_thread_t *p_input )
{
Trigger( p_input, INPUT_EVENT_ABORT );
}
void input_SendEventPosition( input_thread_t *p_input, double f_position, mtime_t i_time ) void input_SendEventPosition( input_thread_t *p_input, double f_position, mtime_t i_time )
{ {
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
* Event for input.c * Event for input.c
*****************************************************************************/ *****************************************************************************/
void input_SendEventDead( input_thread_t *p_input ); void input_SendEventDead( input_thread_t *p_input );
void input_SendEventAbort( input_thread_t *p_input );
void input_SendEventPosition( input_thread_t *p_input, double f_position, mtime_t i_time ); void input_SendEventPosition( input_thread_t *p_input, double f_position, mtime_t i_time );
void input_SendEventLength( input_thread_t *p_input, mtime_t i_length ); void input_SendEventLength( input_thread_t *p_input, mtime_t i_length );
void input_SendEventStatistics( input_thread_t *p_input ); void input_SendEventStatistics( input_thread_t *p_input );
......
...@@ -527,22 +527,14 @@ static void *Run( void *obj ) ...@@ -527,22 +527,14 @@ static void *Run( void *obj )
input_thread_t *p_input = (input_thread_t *)obj; input_thread_t *p_input = (input_thread_t *)obj;
const int canc = vlc_savecancel(); const int canc = vlc_savecancel();
if( Init( p_input ) ) if( !Init( p_input ) )
goto exit; {
MainLoop( p_input, true ); /* FIXME it can be wrong (like with VLM) */ MainLoop( p_input, true ); /* FIXME it can be wrong (like with VLM) */
/* Clean up */ /* Clean up */
End( p_input ); End( p_input );
}
exit:
/* Tell we're dead */
vlc_mutex_lock( &p_input->p->lock_control );
const bool b_abort = p_input->p->b_abort;
vlc_mutex_unlock( &p_input->p->lock_control );
if( b_abort )
input_SendEventAbort( p_input );
input_SendEventDead( p_input ); input_SendEventDead( p_input );
vlc_restorecancel( canc ); vlc_restorecancel( canc );
......
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