* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.23 2001/02/20 02:53:13 stef Exp $
+ * $Id: input_ext-intf.h,v 1.24 2001/02/20 08:47:24 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
int i_area_nb;
input_area_t ** pp_areas; /* list of areas in stream == offset
* interval with own properties */
+ input_area_t * p_selected_area;
u32 i_mux_rate; /* the rate we read the stream (in
* units of 50 bytes/s) ; 0 if undef */
* dvd_css.c: Functions for DVD authentification and unscrambling
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: dvd_css.c,v 1.12 2001/02/20 07:49:12 sam Exp $
+ * $Id: dvd_css.c,v 1.13 2001/02/20 08:47:25 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
{
#ifdef STATS
intf_WarnMsg( 1, "%d) %02X %02X %02X %02X %02X - %3.2f%%", i,
- p_title_key[i].key[0], p_title_key[i].key[1],
- p_title_key[i].key[2], p_title_key[i].key[3],
- p_title_key[i].key[4],
+ p_title_key[i].pi_key[0], p_title_key[i].pi_key[1],
+ p_title_key[i].pi_key[2], p_title_key[i].pi_key[3],
+ p_title_key[i].pi_key[4],
p_title_key[i].i_occ * 100.0 / i_total_keys_found );
#endif
if( p_title_key[i_highest].i_occ * 100.0 / i_total_keys_found
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.16 2001/02/20 07:49:12 sam Exp $
+ * $Id: input_dvd.c,v 1.17 2001/02/20 08:47:25 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
int i_audio, int i_spu )
{
thread_dvd_data_t * p_method;
- es_descriptor_t * p_es;
+// es_descriptor_t * p_es;
off_t i_start;
off_t i_size;
pgc_t * p_pgc;
int i_end_cell;
int i_index;
int i_cell;
- int i_nb;
- int i_id;
- int i;
+// int i_nb;
+// int i_id;
+// int i;
p_method = (thread_dvd_data_t*)p_input->p_plugin_data;
p_es->i_stream_id = 0xbd;
p_es->i_type = DVD_SPU_ES;
// p_es->psz_desc = p_method->ifo.vts.mat.pi_subpic_attr[i];
- if( i == 0 )
+ if( i == 12 )
{
input_SelectES( p_input, p_es );
}
}
/* area definition */
- p_input->stream.pp_areas[0]->i_start = i_start;
- p_input->stream.pp_areas[0]->i_size = i_size;
+ p_input->stream.pp_areas[i_title]->i_start = i_start;
+ p_input->stream.pp_areas[i_title]->i_size = i_size;
/* No PSM to read in DVD mode */
p_input->stream.pp_programs[0]->b_is_ok = 1;
+ /* Init has been successfull ; change the default area */
+ p_input->stream.p_selected_area = p_input->stream.pp_areas[i_title];
+
vlc_mutex_unlock( &p_input->stream.stream_lock );
#else
+ p_input->stream.p_selected_area = p_input->stream.pp_areas[0];
if( p_input->stream.b_seekable )
{
}
/* File too big. */
- if( p_input->stream.pp_areas[0]->i_tell > INPUT_PREPARSE_LENGTH )
+ if( p_input->stream.p_selected_area->i_tell >
+ INPUT_PREPARSE_LENGTH )
{
break;
}
/* i_tell is an indicator from the beginning of the stream,
* not of the DVD */
- p_input->stream.pp_areas[0]->i_tell = 0;
+ p_input->stream.p_selected_area->i_tell = 0;
if( p_demux_data->b_has_PSM )
{
#endif
/* FIXME : ugly kludge */
- p_input->stream.pp_areas[0]->i_size = i_size;
+ p_input->stream.p_selected_area->i_size = i_size;
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
p_input->stream.pp_programs[0]->b_is_ok = 0;
/* FIXME : ugly kludge */
- p_input->stream.pp_areas[0]->i_size = i_size;
+ p_input->stream.p_selected_area->i_size = i_size;
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
pp_packets[i_packet] = NULL;
vlc_mutex_lock( &p_input->stream.stream_lock );
- p_input->stream.pp_areas[0]->i_tell += p_method->i_read_once *DVD_LB_SIZE;
+ p_input->stream.p_selected_area->i_tell +=
+ p_method->i_read_once *DVD_LB_SIZE;
vlc_mutex_unlock( &p_input->stream.stream_lock );
return( 0 );
p_method = ( thread_dvd_data_t * )p_input->p_plugin_data;
/* We have to take care of offset of beginning of title */
- i_pos = i_off + p_input->stream.pp_areas[0]->i_start;
+ i_pos = i_off + p_input->stream.p_selected_area->i_start;
/* With DVD, we have to be on a sector boundary */
i_pos = i_pos & (~0x7ff);
i_pos = lseek( p_input->i_handle, i_pos, SEEK_SET );
- p_input->stream.pp_areas[0]->i_tell = i_pos - p_input->stream.pp_areas[0]->i_start;
+ p_input->stream.p_selected_area->i_tell = i_pos -
+ p_input->stream.p_selected_area->i_start;
return;
}
if( p_intf->p_input != NULL )
{
i_seek = (p_adj->value *
- p_intf->p_input->stream.pp_areas[0]->i_size) / 100;
+ p_intf->p_input->stream.p_selected_area->i_size) / 100;
input_Seek( p_intf->p_input, i_seek );
}
p_intf->p_sys->b_scale_isfree = 1;
* intf_gnome.c: Gnome interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_gnome.c,v 1.15 2001/02/20 07:49:13 sam Exp $
+ * $Id: intf_gnome.c,v 1.16 2001/02/20 08:47:25 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
p_adj = gtk_range_get_adjustment ( GTK_RANGE( p_scale ) );
/* Update the value */
- p_adj->value = ( 100. * p_intf->p_input->stream.pp_areas[0]->i_tell )
- / p_intf->p_input->stream.pp_areas[0]->i_size;
+ p_adj->value = ( 100. *
+ p_intf->p_input->stream.p_selected_area->i_tell ) /
+ p_intf->p_input->stream.p_selected_area->i_size;
/* Gtv does it this way. Why not. */
gtk_range_set_adjustment ( GTK_RANGE( p_scale ), p_adj );
* input_ps.c: PS demux and packet management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input_ps.c,v 1.8 2001/02/20 07:49:13 sam Exp $
+ * $Id: input_ps.c,v 1.9 2001/02/20 08:47:25 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
}
/* File too big. */
- if( p_input->stream.pp_areas[0]->i_tell > INPUT_PREPARSE_LENGTH )
+ if( p_input->stream.p_selected_area->i_tell >
+ INPUT_PREPARSE_LENGTH )
{
break;
}
}
rewind( p_method->stream );
vlc_mutex_lock( &p_input->stream.stream_lock );
- p_input->stream.pp_areas[0]->i_tell = 0;
+ p_input->stream.p_selected_area->i_tell = 0;
if( p_demux_data->b_has_PSM )
{
/* (The PSM decoder will care about spawning the decoders) */
}
}
vlc_mutex_lock( &p_input->stream.stream_lock );
- p_input->stream.pp_areas[0]->i_tell += i_len;
+ p_input->stream.p_selected_area->i_tell += i_len;
vlc_mutex_unlock( &p_input->stream.stream_lock );
return( 0 );
}
/* A little bourrin but should work for a while --Meuuh */
fseeko( p_method->stream, i_position, SEEK_SET );
- p_input->stream.pp_areas[0]->i_tell = i_position;
+ p_input->stream.p_selected_area->i_tell = i_position;
}
/*
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input.c,v 1.85 2001/02/20 02:53:13 stef Exp $
+ * $Id: input.c,v 1.86 2001/02/20 08:47:25 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
p_input->stream.pp_areas = NULL;
/* By default there is one areas in a stream */
input_AddArea( p_input );
- p_input->stream.pp_areas[0]->i_seek = NO_SEEK;
+ p_input->stream.p_selected_area = p_input->stream.pp_areas[0];
+ p_input->stream.p_selected_area->i_seek = NO_SEEK;
/* Initialize stream control properties. */
p_input->stream.control.i_status = PLAYING_S;
#endif
vlc_mutex_lock( &p_input->stream.stream_lock );
- if( p_input->stream.pp_areas[0]->i_seek != NO_SEEK )
+ if( p_input->stream.p_selected_area->i_seek != NO_SEEK )
{
if( p_input->stream.b_seekable && p_input->pf_seek != NULL )
{
- p_input->pf_seek( p_input, p_input->stream.pp_areas[0]->i_seek );
+ p_input->pf_seek( p_input,
+ p_input->stream.p_selected_area->i_seek );
for( i = 0; i < p_input->stream.i_pgrm_number; i++ )
{
p_pgrm->i_synchro_state = SYNCHRO_REINIT;
}
}
- p_input->stream.pp_areas[0]->i_seek = NO_SEEK;
+ p_input->stream.p_selected_area->i_seek = NO_SEEK;
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
|| S_ISBLK(stat_info.st_mode) )
{
p_input->stream.b_seekable = 1;
- p_input->stream.pp_areas[0]->i_size = stat_info.st_size;
+ p_input->stream.p_selected_area->i_size = stat_info.st_size;
}
else if( S_ISFIFO(stat_info.st_mode)
#ifndef SYS_BEOS
)
{
p_input->stream.b_seekable = 0;
- p_input->stream.pp_areas[0]->i_size = 0;
+ p_input->stream.p_selected_area->i_size = 0;
}
else
{
return;
}
- p_input->stream.pp_areas[0]->i_tell = 0;
+ p_input->stream.p_selected_area->i_tell = 0;
vlc_mutex_unlock( &p_input->stream.stream_lock );
intf_Msg( "input: opening %s", p_input->p_source );
void input_Seek( input_thread_t * p_input, off_t i_position )
{
vlc_mutex_lock( &p_input->stream.stream_lock );
- p_input->stream.pp_areas[0]->i_seek = i_position;
+ p_input->stream.p_selected_area->i_seek = i_position;
intf_Msg( "input: seeking position %lld/%lld", i_position,
- p_input->stream.pp_areas[0]->i_size );
+ p_input->stream.p_selected_area->i_size );
vlc_cond_signal( &p_input->stream.stream_wait );
vlc_mutex_unlock( &p_input->stream.stream_lock );
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_programs.c,v 1.32 2001/02/20 02:53:13 stef Exp $
+ * $Id: input_programs.c,v 1.33 2001/02/20 08:47:25 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
intf_Msg( "input info: Dumping stream ID 0x%x", S.i_stream_id );
if( S.b_seekable )
intf_Msg( "input info: seekable stream, position: %lld/%lld",
- S.pp_areas[0].i_tell, S.pp_areas[0].i_size );
+ S.p_selected_area->i_tell, S.p_selected_area->i_size );
else
intf_Msg( "input info: %s", S.b_pace_control ? "pace controlled" :
"pace un-controlled" );