From: Laurent Aimar Date: Wed, 27 Aug 2008 13:00:56 +0000 (+0200) Subject: Jump to first title on menu error (workaround #1809) X-Git-Tag: 1.0.0-pre1~3787 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=d4887e009e9d6c9f48a719ec26ee55b119f6fd29;p=vlc Jump to first title on menu error (workaround #1809) It will make dvdnav and dvdsimple having the same behaviour. --- diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c index 95f91ac6ec..2ccc90311e 100644 --- a/modules/access/dvdnav.c +++ b/modules/access/dvdnav.c @@ -166,6 +166,8 @@ static int ProbeDVD( demux_t *, char * ); static char *DemuxGetLanguageCode( demux_t *p_demux, const char *psz_var ); +static int ControlInternal( demux_t *, int, ... ); + /***************************************************************************** * DemuxOpen: *****************************************************************************/ @@ -566,6 +568,17 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) } } +static int ControlInternal( demux_t *p_demux, int i_query, ... ) +{ + va_list args; + int i_result; + + va_start( args, i_query ); + i_result = Control( p_demux, i_query, args ); + va_end( args ); + + return i_result; +} /***************************************************************************** * Demux: *****************************************************************************/ @@ -588,6 +601,11 @@ static int Demux( demux_t *p_demux ) { msg_Warn( p_demux, "cannot get next block (%s)", dvdnav_err_to_string( p_sys->dvdnav ) ); + if( p_demux->info.i_title == 0 ) + { + msg_Dbg( p_demux, "jumping to first title" ); + return ControlInternal( p_demux, DEMUX_SET_TITLE, 1 ) == VLC_SUCCESS ? 1 : -1; + } return -1; }