* aout_internal.h : internal defines for audio output
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: aout_internal.h,v 1.39 2003/03/04 03:27:40 gbazin Exp $
+ * $Id: aout_internal.h,v 1.40 2003/03/06 23:10:11 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/* 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.8 2003/02/26 18:15:33 massiot Exp $
+ * $Id: dec.c,v 1.9 2003/03/06 23:10:11 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
#include "audio_output.h"
#include "aout_internal.h"
+#include <vlc/input.h> /* for input_thread_t and i_pts_delay */
/*
* Creation/Deletion
/*****************************************************************************
* aout_DecNew : create a decoder
*****************************************************************************/
-static aout_input_t * DecNew( aout_instance_t * p_aout,
+static aout_input_t * DecNew( vlc_object_t * p_this, aout_instance_t * p_aout,
audio_sample_format_t * p_format )
{
aout_input_t * p_input;
+ input_thread_t * p_input_thread;
/* We can only be called by the decoder, so no need to lock
* p_input->lock. */
vlc_mutex_unlock( &p_aout->mixer_lock );
+ 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;
+ vlc_object_release( p_input_thread );
+ }
+ else
+ {
+ p_aout->i_pts_delay = DEFAULT_PTS_DELAY;
+ }
+
return p_input;
}
}
}
- return DecNew( *pp_aout, p_format );
+ return DecNew( p_this, *pp_aout, p_format );
}
/*****************************************************************************
return -1;
}
- if ( p_buffer->start_date > mdate() + AOUT_MAX_ADVANCE_TIME )
+ if ( p_buffer->start_date > mdate() + p_aout->i_pts_delay +
+ AOUT_MAX_ADVANCE_TIME )
{
msg_Warn( p_aout, "received buffer in the future ("I64Fd")",
p_buffer->start_date - mdate());
return 0;
}
-