[vlc-devel] commit: Use audio desync as initial audio-delay value. (Laurent Aimar )
git version control
git at videolan.org
Tue Sep 30 22:30:59 CEST 2008
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Sep 29 20:52:32 2008 +0200| [647d418b640dc0460ba73925eafeb271478e21d2] | committer: Laurent Aimar
Use audio desync as initial audio-delay value.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=647d418b640dc0460ba73925eafeb271478e21d2
---
include/vlc_aout.h | 3 ---
src/audio_output/dec.c | 7 -------
src/input/input.c | 3 ++-
src/input/var.c | 8 +++++---
4 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/include/vlc_aout.h b/include/vlc_aout.h
index dbe1102..02edb38 100644
--- a/include/vlc_aout.h
+++ b/include/vlc_aout.h
@@ -290,9 +290,6 @@ struct aout_input_t
int i_last_input_rate;
/* internal caching delay from input */
int i_pts_delay;
- /* desynchronisation delay request by the user */
- int i_desync;
-
};
/** an output stream for the audio output */
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 3ca6da1..808e70c 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -155,21 +155,18 @@ static aout_input_t * DecNew( vlc_object_t * p_this, aout_instance_t * p_aout,
aout_unlock_input_fifos( p_aout );
aout_unlock_mixer( p_aout );
- p_input->i_desync = var_CreateGetInteger( p_this, "audio-desync" ) * 1000;
p_input_thread = (input_thread_t *)vlc_object_find( p_this,
VLC_OBJECT_INPUT, FIND_PARENT );
if( p_input_thread )
{
p_input->i_pts_delay = p_input_thread->i_pts_delay;
- p_input->i_pts_delay += p_input->i_desync;
p_input->p_input_thread = p_input_thread;
vlc_object_release( p_input_thread );
}
else
{
p_input->i_pts_delay = DEFAULT_PTS_DELAY;
- p_input->i_pts_delay += p_input->i_desync;
p_input->p_input_thread = NULL;
}
@@ -335,10 +332,6 @@ int aout_DecPlay( aout_instance_t * p_aout, aout_input_t * p_input,
return 0;
}
- /* Apply the desynchronisation requested by the user */
- p_buffer->start_date += p_input->i_desync;
- p_buffer->end_date += p_input->i_desync;
-
if ( p_buffer->start_date > mdate() + p_input->i_pts_delay +
AOUT_MAX_ADVANCE_TIME )
{
diff --git a/src/input/input.c b/src/input/input.c
index 2c7b746..9e39fee 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -925,7 +925,8 @@ static void InitTitle( input_thread_t * p_input )
/* If the desynchronisation requested by the user is < 0, we need to
* cache more data. */
var_Get( p_input, "audio-desync", &val );
- if( val.i_int < 0 ) p_input->i_pts_delay -= (val.i_int * 1000);
+ if( val.i_int < 0 )
+ p_input->i_pts_delay -= (val.i_int * 1000);
/* Update cr_average depending on the caching */
p_input->p->input.i_cr_average *= (10 * p_input->i_pts_delay / 200000);
diff --git a/src/input/var.c b/src/input/var.c
index 22ad2ad..b44757f 100644
--- a/src/input/var.c
+++ b/src/input/var.c
@@ -188,7 +188,7 @@ void input_ControlVarInit ( input_thread_t *p_input )
/* Delay */
var_Create( p_input, "audio-delay", VLC_VAR_TIME );
- val.i_time = 0;
+ val.i_time = INT64_C(1000) * var_GetInteger( p_input, "audio-desync" );
var_Change( p_input, "audio-delay", VLC_VAR_SETVALUE, &val, NULL );
var_Create( p_input, "spu-delay", VLC_VAR_TIME );
val.i_time = 0;
@@ -770,15 +770,17 @@ static int EsDelayCallback ( vlc_object_t *p_this, char const *psz_cmd,
if( !strcmp( psz_cmd, "audio-delay" ) )
{
- /*Change i_pts_delay to make sure es are decoded in time*/
- if (newval.i_int < 0 || oldval.i_int < 0 )
+ /* Change i_pts_delay to make sure es are decoded in time */
+ if( newval.i_int < 0 || oldval.i_int < 0 )
{
p_input->i_pts_delay -= newval.i_int - oldval.i_int;
}
input_ControlPush( p_input, INPUT_CONTROL_SET_AUDIO_DELAY, &newval );
}
else if( !strcmp( psz_cmd, "spu-delay" ) )
+ {
input_ControlPush( p_input, INPUT_CONTROL_SET_SPU_DELAY, &newval );
+ }
return VLC_SUCCESS;
}
More information about the vlc-devel
mailing list