[vlc-devel] commit: Jump to first title on menu error (workaround #1809) ( Laurent Aimar )

git version control git at videolan.org
Wed Aug 27 17:54:14 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed Aug 27 15:00:56 2008 +0200| [d4887e009e9d6c9f48a719ec26ee55b119f6fd29] | committer: Laurent Aimar 

Jump to first title on menu error (workaround #1809)

It will make dvdnav and dvdsimple having the same behaviour.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d4887e009e9d6c9f48a719ec26ee55b119f6fd29
---

 modules/access/dvdnav.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index 95f91ac..2ccc903 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;
     }
 




More information about the vlc-devel mailing list