]> git.sesse.net Git - vlc/commitdiff
added start playback in paused mode (#2936)
authorAleksandr Pasechnik <al@megamicron.net>
Fri, 13 Mar 2015 01:49:52 +0000 (01:49 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 25 Mar 2015 14:50:58 +0000 (15:50 +0100)
Added a boolean Playlist preference called start-pause.

Setting the preference causes the src/input/input.c Run function to call the
ControlPause function after Init finishes successfully.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
NEWS
src/input/input.c
src/libvlc-module.c

diff --git a/NEWS b/NEWS
index b2e443b674a63456a1e0b8b1350a632cbe219d1f..420a4be7ed8575d5557075a15ce649e8f4ac7bc3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ Changes between 2.2.x and 3.0.0-git:
 
 Core:
  * Support wayland surface type
+ * Allow to start the video paused on the first frame
 
 Access:
  * Support HDS (Http Dynamic Streaming) from Adobe (f4m, f4v, etc.)
index 23ee04166f12a551ec49c4931d7cc92e797500e7..f1d9e8f7a32b33cf0c77cc8122dd2cd1f1155d47 100644 (file)
@@ -72,6 +72,7 @@ static inline int ControlPop( input_thread_t *, int *, vlc_value_t *, mtime_t i_
 static void       ControlRelease( int i_type, vlc_value_t val );
 static bool       ControlIsSeekRequest( int i_type );
 static bool       Control( input_thread_t *, int, vlc_value_t );
+static void       ControlPause( input_thread_t *, mtime_t );
 
 static int  UpdateTitleSeekpointFromDemux( input_thread_t * );
 static void UpdateGenericFromDemux( input_thread_t * );
@@ -539,6 +540,12 @@ static void *Run( void *obj )
 
     if( !Init( p_input ) )
     {
+        if( var_InheritBool( p_input, "start-paused" ) )
+        {
+            const mtime_t i_control_date = mdate();
+            ControlPause( p_input, i_control_date );
+        }
+
         MainLoop( p_input, true ); /* FIXME it can be wrong (like with VLM) */
 
         /* Clean up */
index a2474cb34545c12da41fa4e02e5ae896a57c8699..46180f5cf7b01b5d883076fae2b5177227013f35 100644 (file)
@@ -1133,6 +1133,10 @@ static const char *const psz_recursive_list_text[] = {
 #define PAP_LONGTEXT N_( \
     "Pause each item in the playlist on the last frame." )
 
+#define SP_TEXT N_("Start paused")
+#define SP_LONGTEXT N_( \
+    "Pause each item in the playlist on the first frame." )
+
 #define AUTOSTART_TEXT N_( "Auto start" )
 #define AUTOSTART_LONGTEXT N_( "Automatically start playing the playlist " \
                 "content once it's loaded." )
@@ -1994,6 +1998,7 @@ vlc_module_begin ()
         change_safe()
     add_bool( "play-and-pause", 0, PAP_TEXT, PAP_LONGTEXT, true )
         change_safe()
+    add_bool( "start-paused", 0, SP_TEXT, SP_LONGTEXT, false )
     add_bool( "playlist-autostart", true,
               AUTOSTART_TEXT, AUTOSTART_LONGTEXT, false )
     add_bool( "playlist-cork", true, CORK_TEXT, CORK_LONGTEXT, false )