* 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
*******************************************************************************/
#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. */
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;
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,
/* 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
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
= 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;