char **ppsz_options, int i_options )
{
- input_thread_t * p_input; /* thread descriptor */
- vlc_value_t val;
- int i;
+ input_thread_t *p_input; /* thread descriptor */
+ vlc_value_t val;
+ int i;
/* Allocate descriptor */
p_input = vlc_object_create( p_parent, VLC_OBJECT_INPUT );
/* Initialize thread properties */
p_input->b_eof = 0;
+ p_input->b_out_pace_control = VLC_FALSE;
p_input->p_sys = NULL;
/* Set target */
p_sub_toselect->p_es, VLC_TRUE );
}
+ if( p_input->stream.p_sout )
+ {
+ if( p_input->stream.p_sout->i_out_pace_nocontrol > 0 )
+ {
+ p_input->b_out_pace_control = VLC_FALSE;
+ }
+ else
+ {
+ p_input->b_out_pace_control = VLC_TRUE;
+ }
+ msg_Dbg( p_input, "starting in %s mode",
+ p_input->b_out_pace_control ? "asynch" : "synch" );
+ }
+
return VLC_SUCCESS;
}
* input_clock.c: Clock/System date convertions, stream management
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
- * $Id: input_clock.c,v 1.45 2004/01/06 12:02:06 zorglub Exp $
+ * $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
&& p_input->stream.p_selected_program == p_pgrm )
{
p_pgrm->last_cr = i_clock;
- mwait( ClockToSysdate( p_input, p_pgrm, i_clock ) );
+ if( !p_input->b_out_pace_control )
+ {
+ mwait( ClockToSysdate( p_input, p_pgrm, i_clock ) );
+ }
}
else
{
/* Wait a while before delivering the packets to the decoder.
* In case of multiple programs, we arbitrarily follow the
* clock of the selected program. */
- mwait( ClockToSysdate( p_input, p_pgrm, i_clock ) );
+ if( !p_input->b_out_pace_control )
+ {
+ mwait( ClockToSysdate( p_input, p_pgrm, i_clock ) );
+ }
/* Now take into account interface changes. */
input_ClockManageControl( p_input, p_pgrm, i_clock );
* input_dec.c: Functions for the management of decoders
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
- * $Id: input_dec.c,v 1.94 2004/03/03 20:39:53 gbazin Exp $
+ * $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
{
vlc_bool_t b_own_thread;
+ input_thread_t *p_input;
+
aout_instance_t *p_aout;
aout_input_t *p_aout_input;
if( p_dec->p_owner->b_own_thread )
{
block_FifoPut( p_dec->p_owner->p_fifo, p_block );
+
+ if( p_dec->p_owner->p_input->b_out_pace_control )
+ {
+ /* FIXME !!!!! */
+ while( p_dec->p_owner->p_fifo->i_depth > 10 )
+ {
+ msleep( 1000 );
+ }
+ }
}
else
{
return NULL;
}
p_dec->p_owner->b_own_thread = VLC_TRUE;
+ p_dec->p_owner->p_input = p_input;
p_dec->p_owner->p_aout = NULL;
p_dec->p_owner->p_aout_input = NULL;
p_dec->p_owner->p_vout = NULL;
p_dec->p_owner->p_sout = p_input->stream.p_sout;
p_dec->p_owner->p_sout_input = NULL;
p_dec->p_owner->p_es_descriptor = p_es;
+
+
/* decoder fifo */
if( ( p_dec->p_owner->p_fifo = block_FifoNew( p_dec ) ) == NULL )
{
p_sout_block = p_next;
}
+
+ /* For now it's enough, as only sout inpact on this flag */
+ if( p_dec->p_owner->p_sout->i_out_pace_nocontrol > 0 &&
+ p_dec->p_owner->p_input->b_out_pace_control )
+ {
+ msg_Dbg( p_dec, "switching to synch mode" );
+ p_dec->p_owner->p_input->b_out_pace_control = VLC_FALSE;
+ }
+ else if( p_dec->p_owner->p_sout->i_out_pace_nocontrol <= 0 &&
+ !p_dec->p_owner->p_input->b_out_pace_control )
+ {
+ msg_Dbg( p_dec, "switching to asynch mode" );
+ p_dec->p_owner->p_input->b_out_pace_control = VLC_TRUE;
+ }
}
}
else if( p_dec->fmt_in.i_cat == AUDIO_ES )
* stream_output.c : stream output module
*****************************************************************************
* Copyright (C) 2002-2004 VideoLAN
- * $Id: stream_output.c,v 1.41 2004/03/03 20:39:53 gbazin Exp $
+ * $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
p_sout->psz_sout = strdup( psz_dest );
p_sout->i_preheader = 0;
p_sout->i_padding = 0;
+ p_sout->i_out_pace_nocontrol = 0;
p_sout->p_sys = NULL;
vlc_mutex_init( p_sout, &p_sout->lock );