* aout_spdif: ac3 passthrough output
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: aout_spdif.c,v 1.7 2001/05/30 05:19:03 stef Exp $
+ * $Id: aout_spdif.c,v 1.9 2001/05/31 01:37:08 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Stéphane Borel <stef@via.ecp.fr>
#include "aout_common.h"
#define BLANK_FRAME_MAX 100
+#define SLEEP_TIME 16000
/*****************************************************************************
* aout_SpdifThread: audio output thread that sends raw spdif data
mtime_t mplay;
mtime_t mdelta;
mtime_t mlast = 0;
- mtime_t m_frame_time;
/* get a blank frame ready */
memset( pi_blank, 0, sizeof(pi_blank) );
i_blank = 0;
/* Compute the theorical duration of an ac3 frame */
- m_frame_time = 1000000 * AC3_FRAME_SIZE / p_aout->fifo[0].l_rate;
while( !p_aout->b_die )
{
l_start_frame];
mdelta = mplay - mdate();
- if( mdelta < ( 2 * m_frame_time ) )
+ if( mdelta < ( 2 * SLEEP_TIME ) )
{
intf_WarnMsg( 12, "spdif out (%d):"
"playing frame %lld (%lld)",
mlast = mplay;
/* play spdif frame to the external decoder */
p_aout->pf_play( p_aout,
- p_aout->fifo[i_fifo].buffer +
+ ((byte_t*) p_aout->fifo[i_fifo].buffer +
p_aout->fifo[i_fifo].l_start_frame*
- SPDIF_FRAME_SIZE,
+ SPDIF_FRAME_SIZE ),
p_aout->fifo[i_fifo].l_frame_size );
p_aout->fifo[i_fifo].l_start_frame =
{
/* we leave some time for aout fifo to fill and not to stress
* the external decoder too much */
- msleep( m_frame_time / 2 );
+ msleep( SLEEP_TIME );
}
else
{