Commit cae5489a authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/spudec/spudec.c, modules/codec/spudec/parse.c: fixed a couple
   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.
parent 5cbb47d6
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* parse.c: SPU parser * parse.c: SPU parser
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * 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> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -103,12 +103,14 @@ void E_(ParsePacket)( spudec_thread_t *p_spudec ) ...@@ -103,12 +103,14 @@ void E_(ParsePacket)( spudec_thread_t *p_spudec )
subpicture_t * p_spu; subpicture_t * p_spu;
u8 * p_src; u8 * p_src;
unsigned int i_offset; unsigned int i_offset;
mtime_t i_pts;
msg_Dbg( p_spudec->p_fifo, "trying to gather a 0x%.2x long subtitle", msg_Dbg( p_spudec->p_fifo, "trying to gather a 0x%.2x long subtitle",
p_spudec->i_spu_size ); p_spudec->i_spu_size );
/* We cannot display a subpicture with no date */ /* 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" ); msg_Warn( p_spudec->p_fifo, "subtitle without a date" );
return; return;
...@@ -139,7 +141,7 @@ void E_(ParsePacket)( spudec_thread_t *p_spudec ) ...@@ -139,7 +141,7 @@ void E_(ParsePacket)( spudec_thread_t *p_spudec )
p_spu->p_sys->pi_alpha[3] = 0x0f; p_spu->p_sys->pi_alpha[3] = 0x0f;
/* Get display time now. If we do it later, we may miss the PTS. */ /* 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 */ /* Allocate the temporary buffer we will parse */
p_src = malloc( p_spudec->i_rle_size ); p_src = malloc( p_spudec->i_rle_size );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* spudec.c : SPU decoder thread * spudec.c : SPU decoder thread
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * 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> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -151,6 +151,10 @@ static int InitThread( spudec_thread_t *p_spudec ) ...@@ -151,6 +151,10 @@ static int InitThread( spudec_thread_t *p_spudec )
{ {
if( p_spudec->p_fifo->b_die || p_spudec->p_fifo->b_error ) 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; return -1;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* output.c : internal management of output streams for the audio output * output.c : internal management of output streams for the audio output
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * 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> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -181,10 +181,10 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout, ...@@ -181,10 +181,10 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
vlc_mutex_lock( &p_aout->output_fifo_lock ); vlc_mutex_lock( &p_aout->output_fifo_lock );
p_buffer = p_aout->output.fifo.p_first; 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", 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->end_date - p_buffer->start_date );
p_buffer = p_buffer->p_next; p_buffer = p_buffer->p_next;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment