Commit d1bc2bc3 authored by Christophe Massiot's avatar Christophe Massiot

Fixed a bug (glitch/segfault) when seeking.

parent 138766e6
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* but exported to plug-ins * but exported to plug-ins
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2002 VideoLAN * Copyright (C) 1999-2002 VideoLAN
* $Id: input_ext-plugins.h,v 1.25 2002/05/10 02:04:16 fenrir Exp $ * $Id: input_ext-plugins.h,v 1.26 2002/05/14 21:23:44 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -81,8 +81,7 @@ vlc_thread_t input_RunDecoder( struct input_thread_s *, ...@@ -81,8 +81,7 @@ vlc_thread_t input_RunDecoder( struct input_thread_s *,
struct es_descriptor_s * ); struct es_descriptor_s * );
void input_EndDecoder( struct input_thread_s *, struct es_descriptor_s * ); void input_EndDecoder( struct input_thread_s *, struct es_descriptor_s * );
void input_DecodePES ( struct decoder_fifo_s *, struct pes_packet_s * ); void input_DecodePES ( struct decoder_fifo_s *, struct pes_packet_s * );
void input_EscapeDiscontinuity( struct input_thread_s *, void input_EscapeDiscontinuity( struct input_thread_s * );
struct pgrm_descriptor_s * );
void input_EscapeAudioDiscontinuity( struct input_thread_s * ); void input_EscapeAudioDiscontinuity( struct input_thread_s * );
#else #else
# define input_DecodePES p_symbols->input_DecodePES # define input_DecodePES p_symbols->input_DecodePES
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* decoders. * decoders.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: input.c,v 1.194 2002/04/23 14:16:20 sam Exp $ * $Id: input.c,v 1.195 2002/05/14 21:23:44 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -307,13 +307,14 @@ static int RunThread( input_thread_t *p_input ) ...@@ -307,13 +307,14 @@ static int RunThread( input_thread_t *p_input )
p_input->pf_set_program( p_input, p_input->pf_set_program( p_input,
p_input->stream.p_new_program ); p_input->stream.p_new_program );
/* Escape all decoders for the stream discontinuity they
* will encounter. */
input_EscapeDiscontinuity( p_input );
for( i = 0; i < p_input->stream.i_pgrm_number; i++ ) for( i = 0; i < p_input->stream.i_pgrm_number; i++ )
{ {
pgrm_descriptor_t * p_pgrm pgrm_descriptor_t * p_pgrm
= p_input->stream.pp_programs[i]; = p_input->stream.pp_programs[i];
/* Escape all decoders for the stream discontinuity they
* will encounter. */
input_EscapeDiscontinuity( p_input, p_pgrm );
/* Reinitialize synchro. */ /* Reinitialize synchro. */
p_pgrm->i_synchro_state = SYNCHRO_REINIT; p_pgrm->i_synchro_state = SYNCHRO_REINIT;
...@@ -330,13 +331,14 @@ static int RunThread( input_thread_t *p_input ) ...@@ -330,13 +331,14 @@ static int RunThread( input_thread_t *p_input )
p_input->pf_set_area( p_input, p_input->stream.p_new_area ); p_input->pf_set_area( p_input, p_input->stream.p_new_area );
/* Escape all decoders for the stream discontinuity they
* will encounter. */
input_EscapeDiscontinuity( p_input );
for( i = 0; i < p_input->stream.i_pgrm_number; i++ ) for( i = 0; i < p_input->stream.i_pgrm_number; i++ )
{ {
pgrm_descriptor_t * p_pgrm pgrm_descriptor_t * p_pgrm
= p_input->stream.pp_programs[i]; = p_input->stream.pp_programs[i];
/* Escape all decoders for the stream discontinuity they
* will encounter. */
input_EscapeDiscontinuity( p_input, p_pgrm );
/* Reinitialize synchro. */ /* Reinitialize synchro. */
p_pgrm->i_synchro_state = SYNCHRO_REINIT; p_pgrm->i_synchro_state = SYNCHRO_REINIT;
...@@ -359,13 +361,14 @@ static int RunThread( input_thread_t *p_input ) ...@@ -359,13 +361,14 @@ static int RunThread( input_thread_t *p_input )
p_input->pf_seek( p_input, i_new_pos ); p_input->pf_seek( p_input, i_new_pos );
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
/* Escape all decoders for the stream discontinuity they
* will encounter. */
input_EscapeDiscontinuity( p_input );
for( i = 0; i < p_input->stream.i_pgrm_number; i++ ) for( i = 0; i < p_input->stream.i_pgrm_number; i++ )
{ {
pgrm_descriptor_t * p_pgrm pgrm_descriptor_t * p_pgrm
= p_input->stream.pp_programs[i]; = p_input->stream.pp_programs[i];
/* Escape all decoders for the stream discontinuity they
* will encounter. */
input_EscapeDiscontinuity( p_input, p_pgrm );
/* Reinitialize synchro. */ /* Reinitialize synchro. */
p_pgrm->i_synchro_state = SYNCHRO_REINIT; p_pgrm->i_synchro_state = SYNCHRO_REINIT;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_clock.c: Clock/System date convertions, stream management * input_clock.c: Clock/System date convertions, stream management
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: input_clock.c,v 1.29 2002/03/05 17:46:33 stef Exp $ * $Id: input_clock.c,v 1.30 2002/05/14 21:23:44 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -257,7 +257,7 @@ void input_ClockManageRef( input_thread_t * p_input, ...@@ -257,7 +257,7 @@ void input_ClockManageRef( input_thread_t * p_input,
intf_WarnMsg( 1, "Clock gap, unexpected stream discontinuity" ); intf_WarnMsg( 1, "Clock gap, unexpected stream discontinuity" );
input_ClockInit( p_pgrm ); input_ClockInit( p_pgrm );
p_pgrm->i_synchro_state = SYNCHRO_START; p_pgrm->i_synchro_state = SYNCHRO_START;
input_EscapeDiscontinuity( p_input, p_pgrm ); input_EscapeDiscontinuity( p_input );
} }
p_pgrm->last_cr = i_clock; p_pgrm->last_cr = i_clock;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_dec.c: Functions for the management of decoders * input_dec.c: Functions for the management of decoders
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: input_dec.c,v 1.33 2002/05/12 01:39:36 massiot Exp $ * $Id: input_dec.c,v 1.34 2002/05/14 21:23:44 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -159,14 +159,13 @@ void input_DecodePES( decoder_fifo_t * p_decoder_fifo, pes_packet_t * p_pes ) ...@@ -159,14 +159,13 @@ void input_DecodePES( decoder_fifo_t * p_decoder_fifo, pes_packet_t * p_pes )
/***************************************************************************** /*****************************************************************************
* input_EscapeDiscontinuity: send a NULL packet to the decoders * input_EscapeDiscontinuity: send a NULL packet to the decoders
*****************************************************************************/ *****************************************************************************/
void input_EscapeDiscontinuity( input_thread_t * p_input, void input_EscapeDiscontinuity( input_thread_t * p_input )
pgrm_descriptor_t * p_pgrm )
{ {
int i_es, i; int i_es, i;
for( i_es = 0; i_es < p_pgrm->i_es_number; i_es++ ) for( i_es = 0; i_es < p_input->stream.i_selected_es_number; i_es++ )
{ {
es_descriptor_t * p_es = p_pgrm->pp_es[i_es]; es_descriptor_t * p_es = p_input->stream.pp_selected_es[i_es];
if( p_es->p_decoder_fifo != NULL ) if( p_es->p_decoder_fifo != NULL )
{ {
...@@ -183,22 +182,17 @@ void input_EscapeDiscontinuity( input_thread_t * p_input, ...@@ -183,22 +182,17 @@ void input_EscapeDiscontinuity( input_thread_t * p_input,
*****************************************************************************/ *****************************************************************************/
void input_EscapeAudioDiscontinuity( input_thread_t * p_input ) void input_EscapeAudioDiscontinuity( input_thread_t * p_input )
{ {
int i_pgrm, i_es, i; int i_es, i;
for( i_pgrm = 0; i_pgrm < p_input->stream.i_pgrm_number; i_pgrm++ ) for( i_es = 0; i_es < p_input->stream.i_selected_es_number; i_es++ )
{ {
pgrm_descriptor_t * p_pgrm = p_input->stream.pp_programs[i_pgrm]; es_descriptor_t * p_es = p_input->stream.pp_selected_es[i_es];
for( i_es = 0; i_es < p_pgrm->i_es_number; i_es++ ) if( p_es->p_decoder_fifo != NULL && p_es->b_audio )
{ {
es_descriptor_t * p_es = p_pgrm->pp_es[i_es]; for( i = 0; i < PADDING_PACKET_NUMBER; i++ )
if( p_es->p_decoder_fifo != NULL && p_es->b_audio )
{ {
for( i = 0; i < PADDING_PACKET_NUMBER; i++ ) input_NullPacket( p_input, p_es );
{
input_NullPacket( p_input, p_es );
}
} }
} }
} }
......
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