Commit 2e762050 authored by Christophe Massiot's avatar Christophe Massiot

* src/video_output/vout_synchro.c: New --quiet-synchro config option.

parent a6c7a464
/***************************************************************************** /*****************************************************************************
* vout_synchro.h: frame-dropping structures * vout_synchro.h: frame-dropping structures
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2003 VideoLAN * Copyright (C) 1999-2005 VideoLAN
* $Id$ * $Id$
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
...@@ -37,6 +37,7 @@ struct vout_synchro_t ...@@ -37,6 +37,7 @@ struct vout_synchro_t
int i_frame_rate; int i_frame_rate;
int i_current_rate; int i_current_rate;
vlc_bool_t b_no_skip; vlc_bool_t b_no_skip;
vlc_bool_t b_quiet;
/* date of the beginning of the decoding of the current picture */ /* date of the beginning of the decoding of the current picture */
mtime_t decoding_start; mtime_t decoding_start;
......
/***************************************************************************** /*****************************************************************************
* libvlc.h: main libvlc header * libvlc.h: main libvlc header
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2002 VideoLAN * Copyright (C) 1998-2005 VideoLAN
* $Id$ * $Id$
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
...@@ -277,6 +277,11 @@ static char *ppsz_align_descriptions[] = ...@@ -277,6 +277,11 @@ static char *ppsz_align_descriptions[] =
#define SKIP_FRAMES_LONGTEXT N_( \ #define SKIP_FRAMES_LONGTEXT N_( \
"Disable this option to disable frame drops on MPEG-2 streams.") "Disable this option to disable frame drops on MPEG-2 streams.")
#define QUIET_SYNCHRO_TEXT N_("Quiet synchro")
#define QUIET_SYNCHRO_LONGTEXT N_( \
"Enable this option to avoid flooding the message log with debug " \
"output from the video output synchro.")
#define INPUT_CAT_LONGTEXT N_( \ #define INPUT_CAT_LONGTEXT N_( \
"These options allow you to modify the behavior of the input " \ "These options allow you to modify the behavior of the input " \
"subsystem, such as the DVD or VCD device, the network interface " \ "subsystem, such as the DVD or VCD device, the network interface " \
...@@ -925,6 +930,8 @@ vlc_module_begin(); ...@@ -925,6 +930,8 @@ vlc_module_begin();
change_short('f'); change_short('f');
add_bool( "skip-frames", 1, NULL, SKIP_FRAMES_TEXT, add_bool( "skip-frames", 1, NULL, SKIP_FRAMES_TEXT,
SKIP_FRAMES_LONGTEXT, VLC_TRUE ); SKIP_FRAMES_LONGTEXT, VLC_TRUE );
add_bool( "quiet-synchro", 0, NULL, QUIET_SYNCHRO_TEXT,
QUIET_SYNCHRO_LONGTEXT, VLC_TRUE );
#ifndef SYS_DARWIN #ifndef SYS_DARWIN
add_bool( "overlay", 1, NULL, OVERLAY_TEXT, OVERLAY_LONGTEXT, VLC_TRUE ); add_bool( "overlay", 1, NULL, OVERLAY_TEXT, OVERLAY_LONGTEXT, VLC_TRUE );
#endif #endif
......
/***************************************************************************** /*****************************************************************************
* vout_synchro.c : frame dropping routines * vout_synchro.c : frame dropping routines
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2004 VideoLAN * Copyright (C) 1999-2005 VideoLAN
* $Id$ * $Id$
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
...@@ -130,6 +130,7 @@ vout_synchro_t * __vout_SynchroInit( vlc_object_t * p_object, ...@@ -130,6 +130,7 @@ vout_synchro_t * __vout_SynchroInit( vlc_object_t * p_object,
vlc_object_attach( p_synchro, p_object ); vlc_object_attach( p_synchro, p_object );
p_synchro->b_no_skip = !config_GetInt( p_object, "skip-frames" ); p_synchro->b_no_skip = !config_GetInt( p_object, "skip-frames" );
p_synchro->b_quiet = config_GetInt( p_object, "quiet-synchro" );
/* We use a fake stream pattern, which is often right. */ /* We use a fake stream pattern, which is often right. */
p_synchro->i_n_p = p_synchro->i_eta_p = DEFAULT_NB_P; p_synchro->i_n_p = p_synchro->i_eta_p = DEFAULT_NB_P;
...@@ -216,7 +217,7 @@ vlc_bool_t vout_SynchroChoose( vout_synchro_t * p_synchro, int i_coding_type, ...@@ -216,7 +217,7 @@ vlc_bool_t vout_SynchroChoose( vout_synchro_t * p_synchro, int i_coding_type,
{ {
b_decode = (pts - now) > (TAU_PRIME(I_CODING_TYPE) + DELTA); b_decode = (pts - now) > (TAU_PRIME(I_CODING_TYPE) + DELTA);
} }
if( !b_decode ) if( !b_decode && !p_synchro->b_quiet )
{ {
msg_Warn( p_synchro, msg_Warn( p_synchro,
"synchro trashing I ("I64Fd")", pts - now ); "synchro trashing I ("I64Fd")", pts - now );
...@@ -366,6 +367,7 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type, ...@@ -366,6 +367,7 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type,
if( p_synchro->i_eta_p if( p_synchro->i_eta_p
&& p_synchro->i_eta_p != p_synchro->i_n_p ) && p_synchro->i_eta_p != p_synchro->i_n_p )
{ {
if( !p_synchro->b_quiet )
msg_Dbg( p_synchro, msg_Dbg( p_synchro,
"stream periodicity changed from P[%d] to P[%d]", "stream periodicity changed from P[%d] to P[%d]",
p_synchro->i_n_p, p_synchro->i_eta_p ); p_synchro->i_n_p, p_synchro->i_eta_p );
...@@ -379,6 +381,7 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type, ...@@ -379,6 +381,7 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type,
p_synchro->i_dec_nb_ref = p_synchro->i_nb_ref; p_synchro->i_dec_nb_ref = p_synchro->i_nb_ref;
#if 0 #if 0
if( !p_synchro->b_quiet )
msg_Dbg( p_synchro, "I("I64Fd") P("I64Fd")[%d] B("I64Fd")" msg_Dbg( p_synchro, "I("I64Fd") P("I64Fd")[%d] B("I64Fd")"
"[%d] YUV("I64Fd") : trashed %d:%d/%d", "[%d] YUV("I64Fd") : trashed %d:%d/%d",
p_synchro->p_tau[I_CODING_TYPE], p_synchro->p_tau[I_CODING_TYPE],
...@@ -394,8 +397,9 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type, ...@@ -394,8 +397,9 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type,
p_synchro->i_trashed_pic = p_synchro->i_not_chosen_pic p_synchro->i_trashed_pic = p_synchro->i_not_chosen_pic
= p_synchro->i_pic = 0; = p_synchro->i_pic = 0;
#else #else
if ( p_synchro->i_pic >= 100 ) if( p_synchro->i_pic >= 100 )
{ {
if( !p_synchro->b_quiet )
msg_Dbg( p_synchro, "decoded %d/%d pictures", msg_Dbg( p_synchro, "decoded %d/%d pictures",
p_synchro->i_pic p_synchro->i_pic
- p_synchro->i_trashed_pic, - p_synchro->i_trashed_pic,
...@@ -411,6 +415,7 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type, ...@@ -411,6 +415,7 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type,
if( p_synchro->i_eta_b if( p_synchro->i_eta_b
&& p_synchro->i_eta_b != p_synchro->i_n_b ) && p_synchro->i_eta_b != p_synchro->i_n_b )
{ {
if( !p_synchro->b_quiet )
msg_Dbg( p_synchro, msg_Dbg( p_synchro,
"stream periodicity changed from B[%d] to B[%d]", "stream periodicity changed from B[%d] to B[%d]",
p_synchro->i_n_b, p_synchro->i_eta_b ); p_synchro->i_n_b, p_synchro->i_eta_b );
...@@ -441,10 +446,10 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type, ...@@ -441,10 +446,10 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type,
if( next_pts ) if( next_pts )
{ {
if( next_pts - p_synchro->current_pts if( (next_pts - p_synchro->current_pts
> PTS_THRESHOLD > PTS_THRESHOLD
|| p_synchro->current_pts - next_pts || p_synchro->current_pts - next_pts
> PTS_THRESHOLD ) > PTS_THRESHOLD) && !p_synchro->b_quiet )
{ {
msg_Warn( p_synchro, "vout synchro warning: pts != " msg_Warn( p_synchro, "vout synchro warning: pts != "
"current_date ("I64Fd")", "current_date ("I64Fd")",
...@@ -465,16 +470,16 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type, ...@@ -465,16 +470,16 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type,
(next_dts - p_synchro->backward_pts (next_dts - p_synchro->backward_pts
> PTS_THRESHOLD > PTS_THRESHOLD
|| p_synchro->backward_pts - next_dts || p_synchro->backward_pts - next_dts
> PTS_THRESHOLD) ) > PTS_THRESHOLD) && !p_synchro->b_quiet )
{ {
msg_Warn( p_synchro, "backward_pts != dts ("I64Fd")", msg_Warn( p_synchro, "backward_pts != dts ("I64Fd")",
next_dts next_dts
- p_synchro->backward_pts ); - p_synchro->backward_pts );
} }
if( p_synchro->backward_pts - p_synchro->current_pts if( (p_synchro->backward_pts - p_synchro->current_pts
> PTS_THRESHOLD > PTS_THRESHOLD
|| p_synchro->current_pts - p_synchro->backward_pts || p_synchro->current_pts - p_synchro->backward_pts
> PTS_THRESHOLD ) > PTS_THRESHOLD) && !p_synchro->b_quiet )
{ {
msg_Warn( p_synchro, msg_Warn( p_synchro,
"backward_pts != current_pts ("I64Fd")", "backward_pts != current_pts ("I64Fd")",
...@@ -486,10 +491,10 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type, ...@@ -486,10 +491,10 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type,
} }
else if( next_dts ) else if( next_dts )
{ {
if( next_dts - p_synchro->current_pts if( (next_dts - p_synchro->current_pts
> PTS_THRESHOLD > PTS_THRESHOLD
|| p_synchro->current_pts - next_dts || p_synchro->current_pts - next_dts
> PTS_THRESHOLD ) > PTS_THRESHOLD) && !p_synchro->b_quiet )
{ {
msg_Warn( p_synchro, "dts != current_pts ("I64Fd")", msg_Warn( p_synchro, "dts != current_pts ("I64Fd")",
p_synchro->current_pts p_synchro->current_pts
...@@ -515,6 +520,7 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type, ...@@ -515,6 +520,7 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type,
{ {
/* We cannot be _that_ late, something must have happened, reinit /* We cannot be _that_ late, something must have happened, reinit
* the dates. */ * the dates. */
if( !p_synchro->b_quiet )
msg_Warn( p_synchro, "PTS << now ("I64Fd"), resetting", msg_Warn( p_synchro, "PTS << now ("I64Fd"), resetting",
now - p_synchro->current_pts - DEFAULT_PTS_DELAY ); now - p_synchro->current_pts - DEFAULT_PTS_DELAY );
p_synchro->current_pts = now + DEFAULT_PTS_DELAY; p_synchro->current_pts = now + DEFAULT_PTS_DELAY;
......
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