of problems introduced with the recent changes to the bitstream facility.
* src/audio_output/output.c: fixed a quite annoying bug in aout3 that was
triggering unnecessary trashing of audio frames.
* parse.c: SPU parser
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: parse.c,v 1.2 2002/10/17 08:24:12 sam Exp $
+ * $Id: parse.c,v 1.3 2002/10/31 09:40:26 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
subpicture_t * p_spu;
u8 * p_src;
unsigned int i_offset;
+ mtime_t i_pts;
msg_Dbg( p_spudec->p_fifo, "trying to gather a 0x%.2x long subtitle",
p_spudec->i_spu_size );
/* We cannot display a subpicture with no date */
- if( p_spudec->p_fifo->p_first->i_pts == 0 )
+ NextPTS( &p_spudec->bit_stream, &i_pts, NULL );
+ if( i_pts == 0 )
{
msg_Warn( p_spudec->p_fifo, "subtitle without a date" );
return;
p_spu->p_sys->pi_alpha[3] = 0x0f;
/* Get display time now. If we do it later, we may miss the PTS. */
- p_spu->p_sys->i_pts = p_spudec->p_fifo->p_first->i_pts;
+ p_spu->p_sys->i_pts = i_pts;
/* Allocate the temporary buffer we will parse */
p_src = malloc( p_spudec->i_rle_size );
* spudec.c : SPU decoder thread
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: spudec.c,v 1.5 2002/10/27 16:58:13 gbazin Exp $
+ * $Id: spudec.c,v 1.6 2002/10/31 09:40:26 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
{
if( p_spudec->p_fifo->b_die || p_spudec->p_fifo->b_error )
{
+ /* Call InitBitstream anyway so p_spudec is in a known state
+ * before calling CloseBitstream */
+ InitBitstream( &p_spudec->bit_stream, p_spudec->p_fifo,
+ NULL, NULL );
return -1;
}
* output.c : internal management of output streams for the audio output
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: output.c,v 1.19 2002/10/21 20:00:10 massiot Exp $
+ * $Id: output.c,v 1.20 2002/10/31 09:40:26 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
vlc_mutex_lock( &p_aout->output_fifo_lock );
p_buffer = p_aout->output.fifo.p_first;
- while ( p_buffer && p_buffer->start_date < start_date )
+ while ( p_buffer && p_buffer->start_date < mdate() )
{
msg_Dbg( p_aout, "audio output is too slow (%lld), trashing %lldus",
- start_date - p_buffer->start_date,
+ mdate() - p_buffer->start_date,
p_buffer->end_date - p_buffer->start_date );
p_buffer = p_buffer->p_next;
}