* -udf.* to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: access.c,v 1.8 2002/12/31 01:54:35 massiot Exp $
+ * $Id: access.c,v 1.15 2003/12/22 14:32:55 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
/* override environment variable DVDCSS_METHOD with config option
* (FIXME: this creates a small memory leak) */
- psz_dvdcss_env = config_GetPsz( p_input, "dvd-css-method" );
+ psz_dvdcss_env = config_GetPsz( p_input, "dvdcss-method" );
if( psz_dvdcss_env && *psz_dvdcss_env )
{
char *psz_env;
p_input->stream.i_method = INPUT_METHOD_DVD;
p_input->stream.b_pace_control = 1;
p_input->stream.b_seekable = 1;
- p_input->stream.b_connected = 1;
p_input->stream.p_selected_area->i_size = 0;
p_input->stream.p_selected_area->i_tell = 0;
* is reserved for video_ts.vob */
for( i = 1 ; i <= title_inf.i_title_nb ; i++ )
{
- input_AddArea( p_input );
-
/* Titles are Program Chains */
- area[i]->i_id = i;
+ input_AddArea( p_input, i, title_inf.p_attr[i-1].i_chapter_nb );
/* Absolute start offset and size
* We can only set that with vts ifo, so we do it during the
area[i]->i_start = 0;
area[i]->i_size = 0;
- /* Number of chapters */
- area[i]->i_part_nb = title_inf.p_attr[i-1].i_chapter_nb;
+ /* Default Chapter */
area[i]->i_part = 1;
/* Offset to vts_i_0.ifo */
{
thread_dvd_data_t * p_dvd;
int i_angle;
+ vlc_value_t val;
p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
i_angle = p_program->i_number;
}
#undef title
msg_Dbg( p_input, "angle %d selected", p_dvd->i_angle );
+
+ /* Update the navigation variables without triggering a callback */
+ val.i_int = p_program->i_number;
+ var_Change( p_input, "program", VLC_VAR_SETVALUE, &val, NULL );
}
return 0;
static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
{
thread_dvd_data_t * p_dvd;
+ vlc_value_t val;
p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
if( p_area != p_input->stream.p_selected_area )
{
- int i_vts_title;
- u32 i_first;
- u32 i_last;
+ int i_vts_title;
+ uint32_t i_first;
+ uint32_t i_last;
+ unsigned int i;
/* Reset the Chapter position of the old title */
p_input->stream.p_selected_area->i_part = 1;
DVDLaunchDecoders( p_input );
}
+ /* Update the navigation variables without triggering a callback */
+ val.i_int = p_area->i_id;
+ var_Change( p_input, "title", VLC_VAR_SETVALUE, &val, NULL );
+ var_Change( p_input, "chapter", VLC_VAR_CLEARCHOICES, NULL, NULL );
+ for( i = 1; i <= p_area->i_part_nb; i++ )
+ {
+ val.i_int = i;
+ var_Change( p_input, "chapter", VLC_VAR_ADDCHOICE, &val, NULL );
+ }
+
} /* i_title >= 0 */
else
{
p_input->stream.b_seekable = 1;
p_input->stream.b_changed = 1;
+ /* Update the navigation variables without triggering a callback */
+ val.i_int = p_area->i_part;
+ var_Change( p_input, "chapter", VLC_VAR_SETVALUE, &val, NULL );
+
return 0;
}
#undef vts
/* check block device */
if( stat( psz_device, &stat_info ) == -1 )
{
- msg_Err( p_input, "cannot stat() device `%s' (%s)",
- psz_device, strerror(errno));
+ msg_Warn( p_input, "cannot stat() device `%s' (%s)",
+ psz_device, strerror(errno));
free( psz_device );
return NULL;
}