* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input.c,v 1.77 2001/02/08 13:08:02 massiot Exp $
+ * $Id: input.c,v 1.79 2001/02/11 01:15:11 sam Exp $
*
- * Authors:
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/* Initialize default settings for spawned decoders */
p_input->p_default_aout = p_main->p_aout;
- p_input->p_default_vout = p_main->p_intf->p_vout;
+ p_input->p_default_vout = p_main->p_vout;
/* Create thread and set locks. */
vlc_mutex_init( &p_input->stream.stream_lock );
p_input->c_loops++;
#endif
- vlc_mutex_lock( &p_input->stream.control.control_lock );
- if( p_input->stream.control.i_status == BACKWARD_S
- && p_input->pf_rewind != NULL )
+ vlc_mutex_lock( &p_input->stream.stream_lock );
+ if( p_input->stream.i_seek )
{
- p_input->pf_rewind( p_input );
- /* FIXME: probably don't do it every loop, but when ? */
+ if( p_input->stream.b_seekable && p_input->pf_seek != NULL )
+ {
+ p_input->pf_seek( p_input, p_input->stream.i_seek );
+
+ for( i = 0; i < p_input->stream.i_pgrm_number; i++ )
+ {
+ pgrm_descriptor_t * p_pgrm
+ = p_input->stream.pp_programs[i];
+ /* Escape all decoders for the stream discontinuity they
+ * will encounter. */
+ input_EscapeDiscontinuity( p_input, p_pgrm );
+
+ /* Reinitialize synchro. */
+ p_pgrm->i_synchro_state = SYNCHRO_REINIT;
+ }
+ }
+ p_input->stream.i_seek = 0;
}
- vlc_mutex_unlock( &p_input->stream.control.control_lock );
+ vlc_mutex_unlock( &p_input->stream.stream_lock );
i_error = p_input->pf_read( p_input, pp_packets );
p_input->c_packets_trashed = 0;
#endif
- p_input->p_input_module = module_Need( p_main->p_module_bank,
+ p_input->p_input_module = module_Need( p_main->p_bank,
MODULE_CAPABILITY_INPUT, NULL );
if( p_input->p_input_module == NULL )
if( p_input->b_error )
{
- module_Unneed( p_main->p_module_bank, p_input->p_input_module );
+ module_Unneed( p_main->p_bank, p_input->p_input_module );
}
else
{
p_input->pf_end( p_input );
/* Release modules */
- module_Unneed( p_main->p_module_bank, p_input->p_input_module );
+ module_Unneed( p_main->p_bank, p_input->p_input_module );
/* Destroy Mutex locks */
vlc_mutex_destroy( &p_input->stream.control.control_lock );