]> git.sesse.net Git - vlc/blobdiff - modules/access/dvdnav.c
avcodec: avcodec_alloc_frame() requires avcodec_free_frame()
[vlc] / modules / access / dvdnav.c
index 002fb3824154e79271e819c66a4363d2e3043d2a..858aab7a4320f322357f4d4cb5bd277122924648 100644 (file)
@@ -38,9 +38,7 @@
 #endif
 
 #include <assert.h>
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
+#include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -795,7 +793,6 @@ static int Demux( demux_t *p_demux )
             tk->b_seen = false;
         }
 
-#if defined(HAVE_DVDNAV_GET_VIDEO_RESOLUTION)
         uint32_t i_width, i_height;
         if( dvdnav_get_video_resolution( p_sys->dvdnav,
                                          &i_width, &i_height ) )
@@ -815,7 +812,6 @@ static int Demux( demux_t *p_demux )
             p_sys->sar.i_den = 0;
             break;
         }
-#endif
 
         if( dvdnav_current_title_info( p_sys->dvdnav, &i_title,
                                        &i_part ) == DVDNAV_STATUS_OK )
@@ -860,8 +856,7 @@ static int Demux( demux_t *p_demux )
                 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 )
+                if( i_part >= 1 && i_part <= p_sys->title[i_title]->i_seekpoint )
                 {
                     p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT;
                     p_demux->info.i_seekpoint = i_part - 1;
@@ -1041,13 +1036,16 @@ static void DemuxTitles( demux_t *p_demux )
 
     /* Find out number of titles/chapters */
     dvdnav_get_number_of_titles( p_sys->dvdnav, &i_titles );
+
+    if( i_titles > 90 )
+        msg_Err( p_demux, "This is probably an Arccos Protected DVD. This could take time..." );
+
     for( i = 1; i <= i_titles; i++ )
     {
         int32_t i_chapters;
         uint64_t i_title_length;
         uint64_t *p_chapters_time;
 
-#if defined(HAVE_DVDNAV_DESCRIBE_TITLE_CHAPTERS)
         i_chapters = dvdnav_describe_title_chapters( p_sys->dvdnav, i,
                                                      &p_chapters_time,
                                                      &i_title_length );
@@ -1056,12 +1054,6 @@ static void DemuxTitles( demux_t *p_demux )
             i_title_length = 0;
             p_chapters_time = NULL;
         }
-#else
-        if( dvdnav_get_number_of_parts( p_sys->dvdnav, i, &i_chapters ) != DVDNAV_STATUS_OK )
-            i_chapters = 0;
-        i_title_length = 0;
-        p_chapters_time = NULL;
-#endif
         t = vlc_input_title_New();
         t->i_length = i_title_length * 1000 / 90;
         for( int j = 0; j < __MAX( i_chapters, 1 ); j++ )
@@ -1293,7 +1285,7 @@ static void ESNew( demux_t *p_demux, int i_id )
 
     if( tk->b_seen ) return;
 
-    if( ps_track_fill( tk, 0, i_id ) )
+    if( ps_track_fill( tk, 0, i_id, NULL ) )
     {
         msg_Warn( p_demux, "unknown codec for id=0x%x", i_id );
         return;
@@ -1477,7 +1469,7 @@ static int ProbeDVD( const char *psz_name )
     /* ISO 9660 volume descriptor */
     char iso_dsc[6];
     if( lseek( fd, 0x8000 + 1, SEEK_SET ) == -1
-     || read( fd, iso_dsc, sizeof (iso_dsc) ) < sizeof (iso_dsc)
+     || read( fd, iso_dsc, sizeof (iso_dsc) ) < (int)sizeof (iso_dsc)
      || memcmp( iso_dsc, "CD001\x01", 6 ) )
         goto bailout;