[vlc-commits] dvdnav: skip probing if forced and do not accept "file://"

Rémi Denis-Courmont git at videolan.org
Sun May 8 19:31:09 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May  8 20:27:13 2011 +0300| [a0af84c5ff058edce897330fa5b4060adb8dddc8] | committer: Rémi Denis-Courmont

dvdnav: skip probing if forced and do not accept "file://"

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

 modules/access/dvdnav.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index 7ce239c..d70a205 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -190,11 +190,16 @@ static int Open( vlc_object_t *p_this )
     int         i_angle;
     char        *psz_file;
     char        *psz_code;
+    bool forced = false;
+
+    if( p_demux->psz_access != NULL
+     && !strncmp(p_demux->psz_access, "dvd", 3) )
+        forced = true;
 
     if( !p_demux->psz_file || !*p_demux->psz_file )
     {
         /* Only when selected */
-        if( !p_demux->psz_access || !*p_demux->psz_access )
+        if( !forced )
             return VLC_EGENERIC;
 
         psz_file = var_InheritString( p_this, "dvd" );
@@ -217,7 +222,7 @@ static int Open( vlc_object_t *p_this )
         return VLC_EGENERIC;
 
     /* Try some simple probing to avoid going through dvdnav_open too often */
-    if( ProbeDVD( psz_file ) != VLC_SUCCESS )
+    if( !forced && ProbeDVD( psz_file ) != VLC_SUCCESS )
     {
         free( psz_file );
         return VLC_EGENERIC;



More information about the vlc-commits mailing list