[vlc-devel] commit: Disable play-and-pause for non interactive input. (Laurent Aimar )

git version control git at videolan.org
Mon Sep 14 23:27:59 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Sep 14 23:22:49 2009 +0200| [8f445c7e3fa99d9b4a79010d68957367ac3b60b1] | committer: Laurent Aimar 

Disable play-and-pause for non interactive input.

For the moment, it is only deactivated when using input_Read
and input_Preparse (it was making blocking vlc at start-up).

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

 src/input/input.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 946d634..46236df 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -69,7 +69,7 @@ static input_thread_t * Create  ( vlc_object_t *, input_item_t *,
                                   const char *, bool, input_resource_t * );
 static  int             Init    ( input_thread_t *p_input );
 static void             End     ( input_thread_t *p_input );
-static void             MainLoop( input_thread_t *p_input );
+static void             MainLoop( input_thread_t *p_input, bool b_interactive );
 
 static void ObjectKillChildrens( input_thread_t *, vlc_object_t * );
 
@@ -169,7 +169,7 @@ int __input_Read( vlc_object_t *p_parent, input_item_t *p_item )
 
     if( !Init( p_input ) )
     {
-        MainLoop( p_input );
+        MainLoop( p_input, false );
         End( p_input );
     }
 
@@ -526,7 +526,7 @@ static void *Run( vlc_object_t *p_this )
     if( Init( p_input ) )
         goto exit;
 
-    MainLoop( p_input );
+    MainLoop( p_input, true ); /* FIXME it can be wrong (like with VLM) */
 
     /* Clean up */
     End( p_input );
@@ -702,12 +702,13 @@ static void MainLoopStatistic( input_thread_t *p_input )
  * MainLoop
  * The main input loop.
  */
-static void MainLoop( input_thread_t *p_input )
+static void MainLoop( input_thread_t *p_input, bool b_interactive )
 {
     mtime_t i_start_mdate = mdate();
     mtime_t i_intf_update = 0;
     mtime_t i_statistic_update = 0;
-    bool b_pause_after_eof = var_CreateGetBool( p_input, "play-and-pause" );
+    bool b_pause_after_eof = b_interactive &&
+                             var_CreateGetBool( p_input, "play-and-pause" );
 
     /* Start the timer */
     stats_TimerStop( p_input, STATS_TIMER_INPUT_LAUNCHING );




More information about the vlc-devel mailing list