[vlc-commits] input: merge ABORT and DEAD events

Rémi Denis-Courmont git at videolan.org
Thu Feb 5 21:41:01 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Feb  5 22:30:36 2015 +0200| [bdcdf970545cded745952ec36e76a285cbc7b0eb] | committer: Rémi Denis-Courmont

input: merge ABORT and DEAD events

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bdcdf970545cded745952ec36e76a285cbc7b0eb
---

 include/vlc_input.h         |    2 --
 lib/media_player.c          |    2 +-
 modules/control/dbus/dbus.c |    1 -
 modules/gui/macosx/intf.m   |    5 -----
 src/input/event.c           |    4 ----
 src/input/event.h           |    1 -
 src/input/input.c           |   20 ++++++--------------
 7 files changed, 7 insertions(+), 28 deletions(-)

diff --git a/include/vlc_input.h b/include/vlc_input.h
index 6ec305b..cdcfdd0 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -335,8 +335,6 @@ typedef enum input_event_type_e
     INPUT_EVENT_STATE,
     /* b_dead is true */
     INPUT_EVENT_DEAD,
-    /* a *user* abort has been requested */
-    INPUT_EVENT_ABORT,
 
     /* "rate" has changed */
     INPUT_EVENT_RATE,
diff --git a/lib/media_player.c b/lib/media_player.c
index cb6b604..81762ad 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -302,7 +302,7 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd,
         set_state( p_mi, libvlc_state, false );
         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;
         event.type = libvlc_MediaPlayerStopped;
diff --git a/modules/control/dbus/dbus.c b/modules/control/dbus/dbus.c
index 31733e0..43feeb5 100644
--- a/modules/control/dbus/dbus.c
+++ b/modules/control/dbus/dbus.c
@@ -893,7 +893,6 @@ static int InputCallback( vlc_object_t *p_this, const char *psz_var,
     switch( newval.i_int )
     {
         case INPUT_EVENT_DEAD:
-        case INPUT_EVENT_ABORT:
             i_state = PLAYBACK_STATE_STOPPED;
             break;
         case INPUT_EVENT_STATE:
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 4c48a9e..2df03a8 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -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];
             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:
             break;
     }
diff --git a/src/input/event.c b/src/input/event.c
index 453e04b..e32ca8a 100644
--- a/src/input/event.c
+++ b/src/input/event.c
@@ -55,10 +55,6 @@ void input_SendEventDead( input_thread_t *p_input )
 
     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 )
 {
diff --git a/src/input/event.h b/src/input/event.h
index c8f1071..e91ad11 100644
--- a/src/input/event.h
+++ b/src/input/event.h
@@ -30,7 +30,6 @@
  * Event for input.c
  *****************************************************************************/
 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_SendEventLength( input_thread_t *p_input, mtime_t i_length );
 void input_SendEventStatistics( input_thread_t *p_input );
diff --git a/src/input/input.c b/src/input/input.c
index 4e9fb49..7e6a12d 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -527,22 +527,14 @@ static void *Run( void *obj )
     input_thread_t *p_input = (input_thread_t *)obj;
     const int canc = vlc_savecancel();
 
-    if( Init( p_input ) )
-        goto exit;
-
-    MainLoop( p_input, true ); /* FIXME it can be wrong (like with VLM) */
-
-    /* Clean up */
-    End( p_input );
+    if( !Init( p_input ) )
+    {
+        MainLoop( p_input, true ); /* FIXME it can be wrong (like with VLM) */
 
-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 );
+        /* Clean up */
+        End( p_input );
+    }
 
-    if( b_abort )
-        input_SendEventAbort( p_input );
     input_SendEventDead( p_input );
 
     vlc_restorecancel( canc );



More information about the vlc-commits mailing list