No functionnal changes yet.
input_Control( p_input, INPUT_GET_STATE, &state );
return state;
}
-VLC_EXPORT( decoder_t *, input_DecoderNew, ( input_thread_t *, es_format_t *, sout_instance_t * ) );
+
+typedef struct input_clock_t input_clock_t;
+VLC_EXPORT( decoder_t *, input_DecoderNew, ( input_thread_t *, es_format_t *, input_clock_t *, sout_instance_t * ) );
VLC_EXPORT( void, input_DecoderDelete, ( decoder_t * ) );
VLC_EXPORT( void, input_DecoderDecode,( decoder_t *, block_t * ) );
}
}
- id->p_dec = input_DecoderNew( p_sys->p_input, p_fmt, NULL );
+ id->p_dec = input_DecoderNew( p_sys->p_input, p_fmt, NULL, NULL );
if( id->p_dec == NULL )
{
msg_Err( p_stream, "cannot create decoder for fcc=`%4.4s'",
int64_t i_preroll_end;
input_thread_t *p_input;
+ input_clock_t *p_clock;
aout_instance_t *p_aout;
aout_input_t *p_aout_input;
* \return the spawned decoder object
*/
decoder_t *input_DecoderNew( input_thread_t *p_input,
- es_format_t *fmt, sout_instance_t *p_sout )
+ es_format_t *fmt, input_clock_t *p_clock, sout_instance_t *p_sout )
{
decoder_t *p_dec = NULL;
vlc_value_t val;
return NULL;
}
+ p_dec->p_owner->p_clock = p_clock;
+
if( p_sout && p_sout == p_input->p->p_sout && p_input->p->input.b_can_pace_control )
{
msg_Dbg( p_input, "stream out mode -> no decoder thread" );
}
else
{
- if( p_dec->b_error || (p_block && p_block->i_buffer <= 0) )
+ if( p_dec->b_error || ( p_block && p_block->i_buffer <= 0 ) )
{
- if( p_block ) block_Release( p_block );
+ if( p_block )
+ block_Release( p_block );
}
else
{
bool input_DecoderEmpty( decoder_t * p_dec )
{
- if( p_dec->p_owner->b_own_thread
- && block_FifoCount( p_dec->p_owner->p_fifo ) > 0 )
+ if( p_dec->p_owner->b_own_thread &&
+ block_FifoCount( p_dec->p_owner->p_fifo ) > 0 )
{
return false;
}
{
decoder_t * p_dec = (decoder_t *)p_this;
block_t *p_block;
- int canc = vlc_savecancel ();
+ int canc = vlc_savecancel();
/* The decoder's main loop */
while( !p_dec->b_die && !p_dec->b_error )
{
/* Trash all received PES packets */
p_block = block_FifoGet( p_dec->p_owner->p_fifo );
- if( p_block ) block_Release( p_block );
+ if( p_block )
+ block_Release( p_block );
}
/* We do it here because of the dll loader that wants close() in the
* same thread than open()/decode() */
module_unneed( p_dec, p_dec->p_module );
- vlc_restorecancel (canc);
+ vlc_restorecancel( canc );
return NULL;
}
if( !p_es->p_dec || p_es->p_master )
continue;
- p_es->p_dec_record = input_DecoderNew( p_input, &p_es->fmt, p_sys->p_sout_record );
+ p_es->p_dec_record = input_DecoderNew( p_input, &p_es->fmt, p_es->p_pgrm->p_clock, p_sys->p_sout_record );
}
}
else
es_out_sys_t *p_sys = out->p_sys;
input_thread_t *p_input = p_sys->p_input;
- p_es->p_dec = input_DecoderNew( p_input, &p_es->fmt, p_input->p->p_sout );
+ p_es->p_dec = input_DecoderNew( p_input, &p_es->fmt, p_es->p_pgrm->p_clock, p_input->p->p_sout );
if( p_es->p_dec && !p_es->p_master && p_sys->p_sout_record )
- p_es->p_dec_record = input_DecoderNew( p_input, &p_es->fmt, p_sys->p_sout_record );
+ p_es->p_dec_record = input_DecoderNew( p_input, &p_es->fmt, p_es->p_pgrm->p_clock, p_sys->p_sout_record );
}
static void EsDestroyDecoder( es_out_t *out, es_out_id_t *p_es )
{
#include <vlc_common.h>
-/**
+/** @struct input_clock_t
* This structure is used to manage clock drift and reception jitters
*
* XXX input_clock_GetTS can be called from any threads. All others functions
* MUST be called from one and only one thread.
*/
-typedef struct input_clock_t input_clock_t;
/**
* This function creates a new input_clock_t.