vlc_mutex_unlock( &p_vout->picture_lock );
}
-#if 0
-static void DecoderOptimizePtsDelay( decoder_t *p_dec )
-{
- input_thread_t *p_input = p_dec->p_owner->p_input;
- vout_thread_t *p_vout = p_dec->p_owner->p_vout;
- input_thread_private_t *p_priv = p_input->p;
-
- picture_t *p_old = NULL;
- picture_t *p_young = NULL;
- int i;
-
- /* Enable with --auto-adjust-pts-delay */
- if( !p_priv->pts_adjust.b_auto_adjust )
- return;
-
- for( i = 0; i < I_RENDERPICTURES; i++ )
- {
- picture_t *p_pic = PP_RENDERPICTURE[i];
-
- if( p_pic->i_status != READY_PICTURE )
- continue;
-
- if( !p_old || p_pic->date < p_old->date )
- p_old = p_pic;
- if( !p_young || p_pic->date > p_young->date )
- p_young = p_pic;
- }
-
- if( !p_young || !p_old )
- return;
-
- /* Try to find if we can reduce the pts
- * This first draft is way too simple, and we can't say if the
- * algo will converge. It's also full of constants.
- * But this simple algo allows to reduce the latency
- * to the minimum.
- * The whole point of this, is to bypass the pts_delay set
- * by the access but also the delay arbitraly set by
- * the remote server.
- * Actually the remote server's muxer may set up a
- * pts<->dts delay in the muxed stream. That is
- * why we may end up in having a negative pts_delay,
- * to compensate that artificial delay. */
- const mtime_t i_buffer_length = p_young->date - p_old->date;
- int64_t i_pts_slide = 0;
- if( i_buffer_length < 10000 )
- {
- if( p_priv->pts_adjust.i_num_faulty > 10 )
- {
- i_pts_slide = __MAX(p_input->i_pts_delay *3 / 2, 10000);
- p_priv->pts_adjust.i_num_faulty = 0;
- }
- if( p_priv->pts_adjust.b_to_high )
- {
- p_priv->pts_adjust.b_to_high = !p_priv->pts_adjust.b_to_high;
- p_priv->pts_adjust.i_num_faulty = 0;
- }
- p_priv->pts_adjust.i_num_faulty++;
- }
- else if( i_buffer_length > 100000 )
- {
- if( p_priv->pts_adjust.i_num_faulty > 25 )
- {
- i_pts_slide = -i_buffer_length/2;
- p_priv->pts_adjust.i_num_faulty = 0;
- }
- if( p_priv->pts_adjust.b_to_high )
- {
- p_priv->pts_adjust.b_to_high = !p_priv->pts_adjust.b_to_high;
- p_priv->pts_adjust.i_num_faulty = 0;
- }
- p_priv->pts_adjust.i_num_faulty++;
- }
- if( i_pts_slide != 0 )
- {
- const mtime_t i_pts_delay_org = p_input->i_pts_delay;
-
- p_input->i_pts_delay += i_pts_slide;
-
- /* Don't play with the pts delay for more than -2<->3sec */
- if( p_input->i_pts_delay < -2000000 )
- p_input->i_pts_delay = -2000000;
- else if( p_input->i_pts_delay > 3000000 )
- p_input->i_pts_delay = 3000000;
- i_pts_slide = p_input->i_pts_delay - i_pts_delay_org;
-
- msg_Dbg( p_input, "Sliding the pts by %dms pts delay at %dms picture buffer was %dms",
- (int)i_pts_slide/1000, (int)p_input->i_pts_delay/1000, (int)i_buffer_length/1000);
-
- vlc_mutex_lock( &p_vout->picture_lock );
- /* Slide all the picture */
- for( i = 0; i < I_RENDERPICTURES; i++ )
- PP_RENDERPICTURE[i]->date += i_pts_slide;
- /* FIXME: slide aout/spu */
- vlc_mutex_unlock( &p_vout->picture_lock );
- }
-}
-#endif
-
static void DecoderDecodeVideo( decoder_t *p_dec, block_t *p_block )
{
decoder_owner_sys_t *p_owner = p_dec->p_owner;
vout_DatePicture( p_vout, p_pic, p_pic->date );
- /* Re-enable it but do it right this time */
- //DecoderOptimizePtsDelay( p_dec );
vout_DisplayPicture( p_vout, p_pic );
}
else
"This option is useful if you want to lower the latency when " \
"reading a stream")
-#define AUTO_ADJUST_PTS_DELAY N_("(Experimental) Minimize latency when" \
- "reading live stream.")
-#define AUTO_ADJUST_PTS_DELAY_LONGTEXT N_( \
- "This option is useful if you want to lower the latency when " \
- "reading a stream")
-
#define PLUGIN_PATH_TEXT N_("Modules search path")
#define PLUGIN_PATH_LONGTEXT N_( \
"Additional path for VLC to look for its modules. You can add " \
add_bool( "use-stream-immediate", false, NULL,
USE_STREAM_IMMEDIATE, USE_STREAM_IMMEDIATE_LONGTEXT, true );
- add_bool( "auto-adjust-pts-delay", false, NULL,
- AUTO_ADJUST_PTS_DELAY, AUTO_ADJUST_PTS_DELAY_LONGTEXT, true );
+ add_obsolete_bool( "auto-adjust-pts-delay" );
#if !defined(__APPLE__) && !defined(SYS_BEOS) && defined(LIBVLC_USE_PTHREAD)
add_bool( "rt-priority", false, NULL, RT_PRIORITY_TEXT,