* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: ac3_spdif.c,v 1.1 2001/11/13 12:09:17 henri Exp $
+ * $Id: ac3_spdif.c,v 1.2 2001/11/14 03:38:11 stef Exp $
*
* Authors: Stéphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
/* Handle the dates */
if( p_spdif->i_real_pts )
{
- if(i_current_pts + i_frame_time != p_spdif->i_real_pts)
+ mtime_t i_delta = p_spdif->i_real_pts - i_current_pts -
+ i_frame_time;
+ if( i_delta > i_frame_time || i_delta < -i_frame_time )
{
- intf_WarnMsg( 2, "spdif warning: date discontinuity (%d)",
- p_spdif->i_real_pts - i_current_pts -
- i_frame_time );
+ intf_WarnMsg( 3, "spdif warning: date discontinuity (%d)",
+ i_delta );
}
i_current_pts = p_spdif->i_real_pts;
p_spdif->i_real_pts = 0;
* aout_spdif: ac3 passthrough output
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: aout_spdif.c,v 1.17 2001/10/13 15:34:21 stef Exp $
+ * $Id: aout_spdif.c,v 1.18 2001/11/14 03:38:11 stef Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Stéphane Borel <stef@via.ecp.fr>
#include "audio_output.h"
#include "aout_common.h"
-#define FRAME_TIME 32000
-
/*****************************************************************************
* aout_SpdifThread: audio output thread that sends raw spdif data
* to an external decoder
mtime_t m_old = 0;
- intf_WarnMsg( 3, "aout info: starting spdif output loop" );
+ intf_DbgMsg( "aout debug: starting spdif output loop" );
while( !p_aout->b_die )
{
/* check continuity */
if( (m_play - m_old) != m_frame_time )
{
- intf_WarnMsg( 6, "aout warning: long frame ? (%lld)",
+ intf_DbgMsg( "aout debug: malformed frame ? (%lld)",
m_play - m_old );
- mwait( m_play );
+ mwait( m_play - m_frame_time );
}
else
{
- mwait( m_play - 3* m_frame_time );
+ mwait( m_play - 2 * m_frame_time );
}
m_old = m_play;
}
else
{
- intf_WarnMsg( 6, "aout info: late spdif frame" );
+ intf_DbgMsg( "aout debug: late spdif frame" );
}
}
else
{
vlc_mutex_unlock( &p_aout->fifo[i_fifo].data_lock );
msleep( m_frame_time );
- intf_WarnMsg( 6, "aout info: empty spdif fifo" );
+ intf_WarnMsg( 3, "aout warning: empty spdif fifo" );
}
}
}
}
- intf_WarnMsg( 3, "aout info: exiting spdif loop" );
+ intf_DbgMsg( "aout debug: exiting spdif loop" );
vlc_mutex_lock( &p_aout->fifos_lock );
for ( i_fifo = 0; i_fifo < AOUT_MAX_FIFOS; i_fifo++ )