--- /dev/null
+.*
+vlc
+dep
//#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
p_input->b_die = 1;
}
-#ifdef DEBUG
+#ifdef STATS
p_input->c_loops++;
#endif
}
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;
u16 i_es_pid;
int i_index = 0;
+ int i_es_loop;
pgrm_descriptor_t* p_pgrm;
es_descriptor_t* p_es;
/* 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
+ }
}
}
#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"
#include "xconsole.h"
#include "interface.h"
#include "intf_msg.h"
+#include "intf_cmd.h"
#include "pgm_data.h"
/* ?? remove useless headers */
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++ )
{
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 );
}