* mpegvideo.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: mpegvideo.c,v 1.8 2003/01/23 15:52:04 sam Exp $
+ * $Id: mpegvideo.c,v 1.9 2003/02/26 13:51:36 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
/* TODO: store skipped somewhere so can send it to the mux
* after the input is created */
i_skipped = 0;
- while( ShowBits( &p_pack->bit_stream, 32 ) != 0x1B3 )
+ while( ShowBits( &p_pack->bit_stream, 32 ) != 0x1B3 &&
+ !p_pack->p_fifo->b_die && !p_pack->p_fifo->b_error )
{
RemoveBits( &p_pack->bit_stream, 8 );
i_skipped++;
* input_ext-dec.c: services to the decoders
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_ext-dec.c,v 1.43 2002/12/06 10:10:39 sam Exp $
+ * $Id: input_ext-dec.c,v 1.44 2003/02/26 13:51:36 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
* and not just a PES header */
do
{
+ /* Sanity check. Yes, this can happen if the caller doesn't check
+ * for p_fifo->b_die beforehand. */
+ if( p_bit_stream->p_pes == NULL ) return 0;
+
/* We were reading the last data packet of this PES packet... It's
* time to jump to the next PES packet */
if( p_bit_stream->p_data->p_next == NULL )
else
{
_BitstreamNextDataPacket( p_bit_stream );
+ if( p_bit_stream->p_decoder_fifo->b_die ) return 0;
if( (ptrdiff_t)p_bit_stream->p_byte & (sizeof(WORD_TYPE) - 1) )
{
{
j = i;
_BitstreamNextDataPacket( p_bit_stream );
+ if( p_bit_stream->p_decoder_fifo->b_die ) return 0;
}
((byte_t *)&p_bit_stream->i_showbits_buffer)[i] =
* p_bit_stream->p_byte;
else
{
_BitstreamNextDataPacket( p_bit_stream );
+ if( p_bit_stream->p_decoder_fifo->b_die ) return 0;
i_result |= *(p_bit_stream->p_byte++) << (i_bits - 8);
i_bits -= 8;
}
else
{
_BitstreamNextDataPacket( p_bit_stream );
+ if( p_bit_stream->p_decoder_fifo->b_die ) return 0;
i_result |= *p_bit_stream->p_byte >> i_tmp;
p_bit_stream->fifo.buffer = *(p_bit_stream->p_byte++)
<< ( sizeof(WORD_TYPE) * 8 - i_tmp );
else
{
_BitstreamNextDataPacket( p_bit_stream );
+ if( p_bit_stream->p_decoder_fifo->b_die ) return;
p_bit_stream->p_byte++;
p_bit_stream->fifo.i_available += 8;
}
else
{
_BitstreamNextDataPacket( p_bit_stream );
+ if( p_bit_stream->p_decoder_fifo->b_die ) return;
p_bit_stream->fifo.buffer = *(p_bit_stream->p_byte++)
<< ( sizeof(WORD_TYPE) * 8 - 8
- p_bit_stream->fifo.i_available );