Commit 74e0ebb8 authored by Gildas Bazin's avatar Gildas Bazin

* modules/access/dvdnav.c: by default we try to skip all the warnings intros...

* modules/access/dvdnav.c: by default we try to skip all the warnings intros and go directly to the DVD menu (niark niark niark ;).
parent 752ac121
...@@ -56,6 +56,10 @@ ...@@ -56,6 +56,10 @@
#define CACHING_LONGTEXT N_( \ #define CACHING_LONGTEXT N_( \
"Allows you to modify the default caching value for DVDnav streams. This "\ "Allows you to modify the default caching value for DVDnav streams. This "\
"value should be set in millisecond units." ) "value should be set in millisecond units." )
#define MENU_TEXT N_("Start directly in menu")
#define MENU_LONGTEXT N_( \
"Allows you to start the DVD directly in the main menu. This "\
"will try to skip all the useless warnings introductions." )
static int Open ( vlc_object_t * ); static int Open ( vlc_object_t * );
static void Close( vlc_object_t * ); static void Close( vlc_object_t * );
...@@ -64,6 +68,8 @@ vlc_module_begin(); ...@@ -64,6 +68,8 @@ vlc_module_begin();
set_description( _("DVDnav Input") ); set_description( _("DVDnav Input") );
add_integer( "dvdnav-caching", DEFAULT_PTS_DELAY / 1000, NULL, add_integer( "dvdnav-caching", DEFAULT_PTS_DELAY / 1000, NULL,
CACHING_TEXT, CACHING_LONGTEXT, VLC_TRUE ); CACHING_TEXT, CACHING_LONGTEXT, VLC_TRUE );
add_bool( "dvdnav-menu", VLC_TRUE, NULL,
MENU_TEXT, MENU_LONGTEXT, VLC_FALSE );
set_capability( "access_demux", 5 ); set_capability( "access_demux", 5 );
add_shortcut( "dvd" ); add_shortcut( "dvd" );
add_shortcut( "dvdnav" ); add_shortcut( "dvdnav" );
...@@ -142,6 +148,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -142,6 +148,7 @@ static int Open( vlc_object_t *p_this )
dvdnav_t *p_dvdnav; dvdnav_t *p_dvdnav;
int i_title, i_chapter, i_angle; int i_title, i_chapter, i_angle;
char *psz_name; char *psz_name;
vlc_value_t val;
psz_name = ParseCL( VLC_OBJECT(p_demux), p_demux->psz_path, VLC_TRUE, psz_name = ParseCL( VLC_OBJECT(p_demux), p_demux->psz_path, VLC_TRUE,
&i_title, &i_chapter, &i_angle ); &i_title, &i_chapter, &i_angle );
...@@ -221,7 +228,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -221,7 +228,7 @@ static int Open( vlc_object_t *p_this )
DemuxTitles( p_demux ); DemuxTitles( p_demux );
/* Set forced title/chapter */ /* Set forced title/chapter */
if( i_title != 0 ) if( i_title > 0 )
{ {
if( dvdnav_title_play( p_sys->dvdnav, i_title ) != DVDNAV_STATUS_OK ) if( dvdnav_title_play( p_sys->dvdnav, i_title ) != DVDNAV_STATUS_OK )
{ {
...@@ -235,7 +242,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -235,7 +242,7 @@ static int Open( vlc_object_t *p_this )
} }
} }
if( i_chapter != 1 && i_title != 0 ) if( i_chapter > 1 && i_title > 0 )
{ {
if( dvdnav_part_play( p_sys->dvdnav, i_title, i_chapter ) != if( dvdnav_part_play( p_sys->dvdnav, i_title, i_chapter ) !=
DVDNAV_STATUS_OK ) DVDNAV_STATUS_OK )
...@@ -250,6 +257,31 @@ static int Open( vlc_object_t *p_this ) ...@@ -250,6 +257,31 @@ static int Open( vlc_object_t *p_this )
} }
} }
var_Create( p_demux, "dvdnav-menu", VLC_VAR_BOOL|VLC_VAR_DOINHERIT );
var_Get( p_demux, "dvdnav-menu", &val );
if( i_title == 0 || val.b_bool )
{
msg_Dbg( p_demux, "trying to go to dvd menu" );
if( dvdnav_title_play( p_sys->dvdnav, 1 ) != DVDNAV_STATUS_OK )
{
msg_Warn( p_demux, "cannot set title" );
}
if( dvdnav_menu_call( p_sys->dvdnav, DVD_MENU_Title ) !=
DVDNAV_STATUS_OK )
{
msg_Warn( p_demux, "cannot go to dvd menu" );
}
else
{
p_demux->info.i_update |=
INPUT_UPDATE_TITLE | INPUT_UPDATE_SEEKPOINT;
p_demux->info.i_title = 0;
p_demux->info.i_seekpoint = 0;
}
}
/* Update default_pts to a suitable value for dvdnav access */ /* Update default_pts to a suitable value for dvdnav access */
var_Create( p_demux, "dvdnav-caching", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT ); var_Create( p_demux, "dvdnav-caching", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
...@@ -712,7 +744,7 @@ static char *ParseCL( vlc_object_t *p_this, char *psz_name, vlc_bool_t b_force, ...@@ -712,7 +744,7 @@ static char *ParseCL( vlc_object_t *p_this, char *psz_name, vlc_bool_t b_force,
psz_source = strdup( psz_name ); psz_source = strdup( psz_name );
if( psz_source == NULL ) return NULL; if( psz_source == NULL ) return NULL;
*i_title = 0; *i_title = -1;
*i_chapter = 1; *i_chapter = 1;
*i_angle = 1; *i_angle = 1;
...@@ -741,7 +773,7 @@ static char *ParseCL( vlc_object_t *p_this, char *psz_name, vlc_bool_t b_force, ...@@ -741,7 +773,7 @@ static char *ParseCL( vlc_object_t *p_this, char *psz_name, vlc_bool_t b_force,
} }
} }
*i_title = *i_title >= 0 ? *i_title : 0; *i_title = *i_title >= 0 ? *i_title : -1;
*i_chapter = *i_chapter > 0 ? *i_chapter : 1; *i_chapter = *i_chapter > 0 ? *i_chapter : 1;
*i_angle = *i_angle > 0 ? *i_angle : 1; *i_angle = *i_angle > 0 ? *i_angle : 1;
......
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