* aout_internal.h : internal defines for audio output
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: aout_internal.h,v 1.40 2003/03/06 23:10:11 gbazin Exp $
+ * $Id: aout_internal.h,v 1.41 2003/10/27 21:54:10 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/* If b_error == 1, there is no input pipeline. */
vlc_bool_t b_error;
- /* Did we just change the output format ? (expect buffer inconsistencies) */
+
+ /* Did we just change the output format? (expect buffer inconsistencies) */
vlc_bool_t b_changed;
+
+ /* internal caching delay from input */
+ int i_pts_delay;
+ /* desynchronisation delay request by the user */
+ int i_desync;
+
};
/*****************************************************************************
/* Output plug-in */
aout_output_t output;
-
- int i_pts_delay; /* internal caching */
};
/*****************************************************************************
* dec.c : audio output API towards decoders
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: dec.c,v 1.11 2003/07/31 23:14:32 massiot Exp $
+ * $Id: dec.c,v 1.12 2003/10/27 21:54:10 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
{
aout_input_t * p_input;
input_thread_t * p_input_thread;
+ vlc_value_t val;
/* We can only be called by the decoder, so no need to lock
* p_input->lock. */
{
int i;
- if ( var_Type( p_aout, "audio-device" ) != 0 )
- {
- var_Destroy( p_aout, "audio-device" );
- }
- if ( var_Type( p_aout, "audio-channels" ) != 0 )
- {
- var_Destroy( p_aout, "audio-channels" );
- }
+ var_Destroy( p_aout, "audio-device" );
+ var_Destroy( p_aout, "audio-channels" );
/* Recreate the output using the new format. */
if ( aout_OutputNew( p_aout, p_format ) < 0 )
vlc_mutex_unlock( &p_aout->mixer_lock );
+ var_Create( p_this, "audio-desync", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
+ var_Get( p_this, "audio-desync", &val );
+ p_input->i_desync = val.i_int * 1000;
+
p_input_thread = (input_thread_t *)vlc_object_find( p_this,
VLC_OBJECT_INPUT, FIND_PARENT );
if( p_input_thread )
{
- p_aout->i_pts_delay = p_input_thread->i_pts_delay;
- p_aout->i_pts_delay += p_aout->p_vlc->i_desync;
+ p_input->i_pts_delay = p_input_thread->i_pts_delay;
+ p_input->i_pts_delay += p_input->i_desync;
vlc_object_release( p_input_thread );
}
else
{
- p_aout->i_pts_delay = DEFAULT_PTS_DELAY;
- p_aout->i_pts_delay += p_aout->p_vlc->i_desync;
+ p_input->i_pts_delay = DEFAULT_PTS_DELAY;
+ p_input->i_pts_delay += p_input->i_desync;
}
return p_input;
}
/* Apply the desynchronisation requested by the user */
- p_buffer->start_date += p_aout->p_vlc->i_desync;
- p_buffer->end_date += p_aout->p_vlc->i_desync;
+ p_buffer->start_date += p_input->i_desync;
+ p_buffer->end_date += p_input->i_desync;
- if ( p_buffer->start_date > mdate() + p_aout->i_pts_delay +
+ if ( p_buffer->start_date > mdate() + p_input->i_pts_delay +
AOUT_MAX_ADVANCE_TIME )
{
msg_Warn( p_aout, "received buffer in the future ("I64Fd")",
* libvlc.c: main libvlc source
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.99 2003/10/26 12:46:55 sigmunau Exp $
+ * $Id: libvlc.c,v 1.100 2003/10/27 21:54:10 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
msg_Flush( p_vlc );
/* p_vlc initialization. FIXME ? */
- p_vlc->i_desync = config_GetInt( p_vlc, "desync" ) * (mtime_t)1000;
#if defined( __i386__ )
if( !config_GetInt( p_vlc, "mmx" ) )
* libvlc.h: main libvlc header
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.h,v 1.96 2003/10/12 23:28:36 hartman Exp $
+ * $Id: libvlc.h,v 1.97 2003/10/27 21:54:10 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#if !defined( SYS_DARWIN )
add_bool( "hq-resampling", 1, NULL, AOUT_RESAMP_TEXT, AOUT_RESAMP_LONGTEXT, VLC_TRUE );
#endif
- add_integer( "desync", 0, NULL, DESYNC_TEXT, DESYNC_LONGTEXT, VLC_TRUE );
add_bool( "spdif", 0, NULL, SPDIF_TEXT, SPDIF_LONGTEXT, VLC_FALSE );
#if 0
add_bool( "headphone-opt", 0, NULL, HEADPHONE_TEXT,
HEADPHONE_LONGTEXT, VLC_FALSE );
#endif
+ add_integer( "audio-desync", 0, NULL, DESYNC_TEXT, DESYNC_LONGTEXT, VLC_TRUE );
add_string("audio-filter",0,NULL,AUDIO_FILTER_TEXT,
AUDIO_FILTER_LONGTEXT,VLC_FALSE);