# include <fcntl.h>
#endif
-#include "vlc_keys.h"
-#include "vlc_iso_lang.h"
+#include <vlc_keys.h>
+#include <vlc_iso_lang.h>
/* FIXME we should find a better way than including that */
#include "../../src/text/iso-639_def.h"
bool b_spu_change;
/* */
- int i_aspect;
-
int i_title;
input_title_t **title;
int i_angle;
char *psz_name;
char *psz_code;
- vlc_value_t val;
if( !p_demux->psz_path || !*p_demux->psz_path )
{
psz_name = ToLocaleDup( p_demux->psz_path );
#ifdef WIN32
- if( psz_name[0] && psz_name[1] == ':' &&
- psz_name[2] == '\\' && psz_name[3] == '\0' ) psz_name[2] = '\0';
+ /* Remove trailing backslash, otherwise dvdnav_open will fail */
+ if( *psz_name && *(psz_name + strlen(psz_name) - 1) == '\\' )
+ {
+ *(psz_name + strlen(psz_name) - 1) = '\0';
+ }
#endif
/* Try some simple probing to avoid going through dvdnav_open too often */
p_sys->b_reset_pcr = false;
ps_track_init( p_sys->tk );
- p_sys->i_aspect = -1;
p_sys->i_mux_rate = 0;
p_sys->i_pgc_length = 0;
p_sys->b_spu_change = false;
DemuxTitles( p_demux );
- var_Create( p_demux, "dvdnav-menu", VLC_VAR_BOOL|VLC_VAR_DOINHERIT );
- var_Get( p_demux, "dvdnav-menu", &val );
- if( val.b_bool )
+ if( var_CreateGetBool( p_demux, "dvdnav-menu" ) )
{
msg_Dbg( p_demux, "trying to go to dvd menu" );
}
}
- var_Create( p_demux, "dvdnav-angle", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
- var_Get( p_demux, "dvdnav-angle", &val );
- i_angle = val.i_int > 0 ? val.i_int : 1;
+ i_angle = var_CreateGetInteger( p_demux, "dvdnav-angle" );
+ if( i_angle <= 0 ) i_angle = 1;
/* Update default_pts to a suitable value for dvdnav access */
var_Create( p_demux, "dvdnav-caching", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
/* FIXME hack hack hack hack FIXME */
/* Get p_input and create variable */
- p_sys->p_input = vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT );
+ p_sys->p_input = demux_GetParentInput( p_demux );
var_Create( p_sys->p_input, "x-start", VLC_VAR_INTEGER );
var_Create( p_sys->p_input, "y-start", VLC_VAR_INTEGER );
var_Create( p_sys->p_input, "x-end", VLC_VAR_INTEGER );
/* Stop still image handler */
if( p_sys->still.b_created )
- vlc_timer_destroy( &p_sys->still.timer );
+ vlc_timer_destroy( p_sys->still.timer );
vlc_mutex_destroy( &p_sys->still.lock );
var_Destroy( p_sys->p_input, "highlight-mutex" );
if( event->length != 0xff && p_sys->still.b_created )
{
mtime_t delay = event->length * CLOCK_FREQ;
- vlc_timer_schedule( &p_sys->still.timer, false, delay, 0 );
+ vlc_timer_schedule( p_sys->still.timer, false, delay, 0 );
}
b_still_init = true;
msg_Dbg( p_demux, " - vtsN=%d", event->new_vtsN );
msg_Dbg( p_demux, " - domain=%d", event->new_domain );
- /* dvdnav_get_video_aspect / dvdnav_get_video_scale_permission */
- /* TODO check if we always have VTS and CELL */
- p_sys->i_aspect = dvdnav_get_video_aspect( p_sys->dvdnav );
-
/* reset PCR */
es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
/* Add a new ES */
if( tk->fmt.i_cat == VIDEO_ES )
{
- switch( p_sys->i_aspect )
- {
- case 1: tk->fmt.video.i_aspect = VOUT_ASPECT_FACTOR; break;
- case 2: tk->fmt.video.i_aspect = VOUT_ASPECT_FACTOR * 4 / 3; break;
- case 3: tk->fmt.video.i_aspect = VOUT_ASPECT_FACTOR * 16 / 9; break;
- case 4: tk->fmt.video.i_aspect = VOUT_ASPECT_FACTOR * 221 / 10; break;
- default:
- tk->fmt.video.i_aspect = 0;
- break;
- }
b_select = true;
}
else if( tk->fmt.i_cat == AUDIO_ES )
if( !strcmp( psz_name, "-" ) ) /* stdin -> file access */
return VLC_EGENERIC;
- if( (i_fd = utf8_open( psz_name, O_RDONLY |O_NONBLOCK, 0666 )) == -1 )
+ if( (i_fd = utf8_open( psz_name, O_RDONLY |O_NONBLOCK )) == -1 )
{
return VLC_SUCCESS; /* Let dvdnav_open() do the probing */
}