]> git.sesse.net Git - vlc/commitdiff
* Ajout d'un .cvsignore ;
authorChristophe Massiot <massiot@videolan.org>
Mon, 20 Sep 1999 20:41:28 +0000 (20:41 +0000)
committerChristophe Massiot <massiot@videolan.org>
Mon, 20 Sep 1999 20:41:28 +0000 (20:41 +0000)
* Au d�marrage l'interface lance le script contenu dans vlc.init s'il
  existe (typiquement spawnage d'input) ;
* Le d�codeur PSI spawne automatiquement les threads video et audio des
  qu'il a fini ;
  [les deux pr�c�dents comportements peuvent �tre d�sactiv�s en
   commentant #define AUTO_SPAWN dans config.h]
* Correction d'un bug de compilation dans input_pcr.c

--Meuuh

.cvsignore [new file with mode: 0644]
include/config.h
src/input/input.c
src/input/input_pcr.c
src/input/input_psi.c
src/interface/interface.c

diff --git a/.cvsignore b/.cvsignore
new file mode 100644 (file)
index 0000000..4269a3c
--- /dev/null
@@ -0,0 +1,3 @@
+.*
+vlc
+dep
index e1855a84f95692bd78739f620e9306f2128e9807..771244733876d7f60962b5018617f56dd7da61ce 100644 (file)
@@ -26,7 +26,7 @@
 //#define DVB_RESTRICTIONS
 
 /* Define for profiling support */
-#define STATS
+//#define STATS
 
 /* Define for unthreaded version of the program - ?? not yet implemented */
 //#define NO_THREAD
  * Common settings
  *******************************************************************************/
 
+/* Automagically spawn input, audio and video threads ? */
+#define AUTO_SPAWN
+
+/* Startup script */
+#define INIT_SCRIPT    "vlc.init"
+
 /* ?? */
 #define THREAD_SLEEP    100000
 
index b0260e81408da3a4416c7213059734b4ac8b62d7..e6c17d0f2be2b1001ebe9cf9156db5a3d06b8de6 100644 (file)
@@ -327,7 +327,7 @@ static void input_Thread( input_thread_t *p_input )
             p_input->b_die = 1;
         }
 
-#ifdef DEBUG
+#ifdef STATS
         p_input->c_loops++;
 #endif
     }
index 5dcbd95aa71af2d8c480ee059ee0f480521d435c..602e776dd1e40663fac7a572e85a628afaf38356 100644 (file)
@@ -33,9 +33,9 @@ void input_PcrReInit( input_thread_t *p_input )
     p_pcr = p_input->p_pcr;
 
     p_pcr->c_average = 0;
-    p_pcr->c_average_jitter = 0;
 
 #ifdef STATS
+    p_pcr->c_average_jitter = 0;
     p_pcr->c_pcr = 0;
     p_pcr->max_jitter = 0;
 
index 1150949f04d05c022d4e0a81894b8aed4dd9ad5c..cb7e26b93cb4081e0147c6f2d5a4b4d4ed7ad935 100644 (file)
@@ -434,6 +434,7 @@ static void DecodePgrmMapSection( u8* p_pms, input_thread_t* p_input )
   u16 i_es_pid;
 
   int i_index = 0;
+  int i_es_loop;
   pgrm_descriptor_t* p_pgrm;
   es_descriptor_t* p_es;
 
@@ -590,7 +591,27 @@ static void DecodePgrmMapSection( u8* p_pms, input_thread_t* p_input )
           /* Check if the PMT is now complete */
           p_descr->i_known_PMT_sections++;
           if( p_descr->i_known_PMT_sections >= i_last_section)
-            p_descr->b_is_PMT_complete = 1;
+          {
+              p_descr->b_is_PMT_complete = 1;
+
+#ifdef AUTO_SPAWN
+              /* Spawn an audio and a video thread, if possible. */
+              for( i_es_loop = 0; i_es_loop < INPUT_MAX_ES; i_es_loop++ )
+              {
+                  switch( p_input->p_es[i_es_loop].i_type )
+                  {
+                  case MPEG1_VIDEO_ES:
+                  case MPEG2_VIDEO_ES:
+                  case MPEG1_AUDIO_ES:
+                  case MPEG2_AUDIO_ES:
+                      /* Spawn an audio thread */
+                      input_AddPgrmElem( p_input, p_input->p_es[i_es_loop].i_id );
+                      break;
+                  default:
+                  }
+              }
+#endif
+          }
         }
     }
 
index 74c4d69fda6be3769de92317086bbfcf7e271f86..9cda39cfa12a78fd711e1c6a5bd09fc2b199bf5e 100644 (file)
 #include <X11/Xlib.h>
 #include <X11/extensions/XShm.h>
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
 #include "config.h"
 #include "common.h"
 #include "mtime.h"
@@ -36,6 +40,7 @@
 #include "xconsole.h"
 #include "interface.h"
 #include "intf_msg.h"
+#include "intf_cmd.h"
 
 #include "pgm_data.h"
 /* ?? remove useless headers */
@@ -96,7 +101,10 @@ int intf_Run( intf_thread_t *p_intf )
 static int StartInterface( intf_thread_t *p_intf )
 {
     int i_thread;                                              /* thread index */
-    
+#ifdef AUTO_SPAWN
+    int fd;
+#endif
+
     /* Empty all threads array */
     for( i_thread = 0; i_thread < VOUT_MAX_THREADS; i_thread++ )
     {
@@ -114,6 +122,16 @@ static int StartInterface( intf_thread_t *p_intf )
         return( 1 );
     }
 
+#ifdef AUTO_SPAWN
+    /* Execute the initialization script (typically spawn an input thread) */
+    if ( (fd = open( INIT_SCRIPT, O_RDONLY )) != -1 )
+    {
+        /* Startup script does exist */
+        close( fd );
+        intf_ExecScript( "vlc.init" );
+    }
+#endif
+
     return( 0 );
 }