Commit b25b4229 authored by Stéphane Borel's avatar Stéphane Borel

Am�lioration de la synchro.

--Meuuh
parent a2972b3c
......@@ -194,6 +194,10 @@
* server */
#define INPUT_VLAN_CHANGE_DELAY 5000000
/* Duration between the time we receive the TS packet, and the time we will
* mark it to be presented */
#define INPUT_PTS_DELAY 2000000
/*******************************************************************************
* Audio configuration
*******************************************************************************/
......@@ -288,7 +292,7 @@
#define VPAR_IDLE_SLEEP 100000
/* Time to sleep when waiting for a buffer (from vout or the video fifo). */
#define VPAR_OUTMEM_SLEEP 10000
#define VPAR_OUTMEM_SLEEP 100000
/* Optimization level, from 0 to 2 - 1 is generally a good compromise. Remember
* that raising this level dramatically lengthens the compilation time. */
......
......@@ -1000,7 +1000,7 @@ static __inline__ void input_DemuxPES( input_thread_t *p_input,
case SYNCHRO_START:
p_pes->i_pts += p_pcr->delta_pcr;
p_pcr->delta_absolute = mdate() - p_pes->i_pts + 500000;
p_pcr->delta_absolute = mdate() - p_pes->i_pts + INPUT_PTS_DELAY;
p_pes->i_pts += p_pcr->delta_absolute;
p_pcr->i_synchro_state = 0;
break;
......
......@@ -164,11 +164,17 @@ static void __inline__ ReferenceUpdate( vpar_thread_t * p_vpar,
if( p_newref != NULL )
vout_LinkPicture( p_vpar->p_vout, p_newref );
}
else if( p_newref != NULL )
{
/* Put date immediately. */
vout_DatePicture( p_vpar->p_vout, p_newref,
vpar_SynchroDate( p_vpar ) );
}
}
/*****************************************************************************
* ReferenceReplace : Replace the last reference pointer when we destroy
* a picture
* a picture
*****************************************************************************/
static void __inline__ ReferenceReplace( vpar_thread_t * p_vpar,
int i_coding_type,
......@@ -669,12 +675,6 @@ static void PictureHeader( vpar_thread_t * p_vpar )
/* Initialize values. */
vpar_SynchroDecode( p_vpar, p_vpar->picture.i_coding_type, i_structure );
if( p_vpar->picture.i_coding_type == B_CODING_TYPE )
{
/* Put date immediately. */
vout_DatePicture( p_vpar->p_vout, P_picture,
vpar_SynchroDate( p_vpar ) );
}
P_picture->i_aspect_ratio = p_vpar->sequence.i_aspect_ratio;
P_picture->i_matrix_coefficients = p_vpar->sequence.i_matrix_coefficients;
p_vpar->picture.i_l_stride = ( p_vpar->sequence.i_width
......
......@@ -71,7 +71,9 @@ void vpar_SynchroUpdateStructures( vpar_thread_t * p_vpar,
decoder_fifo_t * decoder_fifo = p_vpar->bit_stream.p_decoder_fifo;
/* interpolate the current _decode_ PTS */
i_current_pts = decoder_fifo->buffer[decoder_fifo->i_start]->i_pts;
i_current_pts = decoder_fifo->buffer[decoder_fifo->i_start]->b_has_pts ?
decoder_fifo->buffer[decoder_fifo->i_start]->i_pts :
0;
if( !i_current_pts )
{
i_current_pts = p_vpar->synchro.i_last_decode_pts
......@@ -84,8 +86,10 @@ void vpar_SynchroUpdateStructures( vpar_thread_t * p_vpar,
= i_current_pts;
/* update display time */
i_displaydate = decoder_fifo->buffer[decoder_fifo->i_start]->i_pts;
if( !i_displaydate || i_coding_type != I_CODING_TYPE )
i_displaydate = decoder_fifo->buffer[decoder_fifo->i_start]->b_has_pts ?
decoder_fifo->buffer[decoder_fifo->i_start]->i_pts :
0;
if( !i_displaydate /* || i_coding_type != I_CODING_TYPE */ )
{
if (!p_vpar->synchro.i_images_since_pts )
p_vpar->synchro.i_images_since_pts = 10;
......
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