]> git.sesse.net Git - vlc/blobdiff - modules/access/dvdnav.c
DShow: change text
[vlc] / modules / access / dvdnav.c
index 381da516450dfc1d712236ed8c45fa697c22808c..e808f0e5bec3c686fc2ae055a7a95136a385dd1b 100644 (file)
 #   include <unistd.h>
 #endif
 #include <sys/types.h>
-#ifdef HAVE_SYS_STAT_H
-#   include <sys/stat.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#   include <fcntl.h>
-#endif
+#include <sys/stat.h>
+#include <fcntl.h>
 #include <errno.h>
 
 #include <vlc_common.h>
@@ -817,12 +813,17 @@ static int Demux( demux_t *p_demux )
         if( dvdnav_current_title_info( p_sys->dvdnav, &i_title,
                                        &i_part ) == DVDNAV_STATUS_OK )
         {
-            if( i_title >= 0 && i_title < p_sys->i_title &&
-                i_part >= 1 && i_part <= p_sys->title[i_title]->i_seekpoint &&
-                p_demux->info.i_seekpoint != i_part - 1 )
+            if( i_title >= 0 && i_title < p_sys->i_title )
             {
-                p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT;
-                p_demux->info.i_seekpoint = i_part - 1;
+                p_demux->info.i_update |= INPUT_UPDATE_TITLE;
+                p_demux->info.i_title = i_title;
+
+                if( i_part >= 1 && i_part <= p_sys->title[i_title]->i_seekpoint &&
+                        p_demux->info.i_seekpoint != i_part - 1 )
+                {
+                    p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT;
+                    p_demux->info.i_seekpoint = i_part - 1;
+                }
             }
         }
         break;
@@ -939,7 +940,6 @@ static char *DemuxGetLanguageCode( demux_t *p_demux, const char *psz_var )
         if( *psz_lang == '\0' )
             continue;
         if( !strcasecmp( pl->psz_eng_name, psz_lang ) ||
-            !strcasecmp( pl->psz_native_name, psz_lang ) ||
             !strcasecmp( pl->psz_iso639_1, psz_lang ) ||
             !strcasecmp( pl->psz_iso639_2T, psz_lang ) ||
             !strcasecmp( pl->psz_iso639_2B, psz_lang ) )
@@ -1454,27 +1454,25 @@ static int ProbeDVD( const char *psz_name )
 #endif
 
     int ret = VLC_EGENERIC;
-
-#ifdef HAVE_SYS_STAT_H
     struct stat stat_info;
 
     if( fstat( fd, &stat_info ) == -1 )
          goto bailout;
-
     if( !S_ISREG( stat_info.st_mode ) )
     {
         if( S_ISDIR( stat_info.st_mode ) || S_ISBLK( stat_info.st_mode ) )
             ret = VLC_SUCCESS; /* Let dvdnav_open() do the probing */
         goto bailout;
     }
-#endif
+
     /* Match extension as the anchor exhibits too many false positives */
     const char *ext = strrchr( psz_name, '.' );
     if( ext == NULL )
         goto bailout;
     ext++;
     if( strcasecmp( ext, "iso" ) && strcasecmp( ext, "img" ) &&
-        strcasecmp( ext, "mdf" ) && strcasecmp( ext, "dvd" ) )
+        strcasecmp( ext, "mdf" ) && strcasecmp( ext, "dvd" ) &&
+        strcasecmp( ext, "bin" ) && strcasecmp( ext, "nrg" ) )
         goto bailout;
 
     /* Try to find the anchor (2 bytes at LBA 256) */