Commit 2dac5c30 authored by Christophe Massiot's avatar Christophe Massiot

* Ajout d'un .cvsignore ;

* 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
parent 72f3067a
.*
vlc
dep
......@@ -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
......@@ -56,6 +56,12 @@
* Common settings
*******************************************************************************/
/* Automagically spawn input, audio and video threads ? */
#define AUTO_SPAWN
/* Startup script */
#define INIT_SCRIPT "vlc.init"
/* ?? */
#define THREAD_SLEEP 100000
......
......@@ -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
}
......
......@@ -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;
......
......@@ -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
}
}
}
......
......@@ -17,6 +17,10 @@
#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 );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment