[vlc-devel] commit: Added a new option, play-and-pause. When this option is set, the input thread is automatically paused when each item reaches the end of the file . (Elliot Murphy )

git version control git at videolan.org
Mon Sep 14 17:17:25 CEST 2009


vlc | branch: master | Elliot Murphy <elliot at elliotmurphy.com> | Mon Jul 27 22:12:55 2009 -0400| [d2054d2cd7ad8f335251073a3efd4831ed507356] | committer: Rémi Denis-Courmont 

Added a new option, play-and-pause. When this option is set, the input thread is automatically paused when each item reaches the end of the file.

This option is intended to make it easier to use VLC during live
productions featuring instructors and speakers working
with American Sign Language (ASL), or really any Sign Language, where
it is common for a lecturer to refer to video clips during a
presentation. The automatic pausing provides a smooth pause for the
video operator to switch the projection system back to the camera
with the live speaker once a clip has finished playing.

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 src/input/input.c   |    8 ++++++++
 src/libvlc-module.c |    8 +++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 9137191..182fdeb 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -631,7 +631,15 @@ static void MainLoopDemux( input_thread_t *p_input, bool *pb_changed, bool *pb_d
 
     if( i_ret == 0 )    /* EOF */
     {
+        bool b_pause_after_each = var_CreateGetBool( p_input, "play-and-pause" );
         msg_Dbg( p_input, "EOF reached" );
+        if ( b_pause_after_each )
+        {
+            msg_Dbg( p_input, "pausing at EOF (pause after each)");
+            vlc_value_t pause_state;
+            pause_state.i_int = PAUSE_S;
+            Control( p_input, INPUT_CONTROL_SET_STATE, pause_state );
+        }
         p_input->p->input.b_eof = true;
     }
     else if( i_ret < 0 )
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 0e9a81b..d92e614 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -1185,7 +1185,11 @@ static const char *const ppsz_albumart_descriptions[] =
 
 #define PAE_TEXT N_("Play and exit")
 #define PAE_LONGTEXT N_( \
-                "Exit if there are no more items in the playlist." )
+    "Exit if there are no more items in the playlist." )
+
+#define PAP_TEXT N_("Play and pause")
+#define PAP_LONGTEXT N_( \
+    "Pause each item in the playlist on the last frame." )
 
 #define ML_TEXT N_("Use media library")
 #define ML_LONGTEXT N_( \
@@ -2006,6 +2010,8 @@ vlc_module_begin ()
     add_bool( "play-and-exit", 0, NULL, PAE_TEXT, PAE_LONGTEXT, false )
     add_bool( "play-and-stop", 0, NULL, PAS_TEXT, PAS_LONGTEXT, false )
         change_safe()
+    add_bool( "play-and-pause", 0, NULL, PAP_TEXT, PAP_LONGTEXT, true )
+        change_safe()
     add_bool( "media-library", 1, NULL, ML_TEXT, ML_LONGTEXT, false )
     add_bool( "playlist-tree", 0, NULL, PLTREE_TEXT, PLTREE_LONGTEXT, false )
 




More information about the vlc-devel mailing list