[libdvdnav-devel] [libdvdread][BUG] Impossible to open DVD directory tree from mounted DVD media

Natrio Natrio at list.ru
Thu Oct 2 08:33:05 CEST 2014


Hello everyone!

The libdvdreadrefuses to open DVD directory tree, if it 
stored on DVD media.
Instead, libdvdread always tries to open device by "guessed" 
name,ignoring a specified custom path:

$ vlc --play-and-exit dvd:// --dvd /media/cdrom/VIDEO_TS/
VLC media player 2.1.5 Rincewind (revision 2.1.4-49-gdab6cb5)
[0x8699508] [http] lua interface: Lua HTTP interface
[0x85fa0d0] main libvlc: Running vlc with the default 
interface. Use 'cvlc' to use vlc without interface.
libdvdnav: Using dvdnav version 5.0.0
libdvdread: Attempting to use device /dev/sr0 mounted on 
/media/cdrom for CSS authentication
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO 
failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP 
failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
libdvdread: Attempting to use device /dev/sr0 mounted on 
/media/cdrom for CSS authentication
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO 
failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP 
failed
libdvdread: Can't open file VIDEO_TS.BUP.
[0xb3400508] main input error: open of `dvd://' failed
[0x8681ad8] main playlist: end of playlist, exiting


To work around this problem, I was forced to make a patch 
that allows me to disable the "guessing" of the device:

diff -pur 1/src/dvd_reader.c 2/src/dvd_reader.c
--- 1/src/dvd_reader.c    2014-04-12 13:29:59.000000000 +0400
+++ 2/src/dvd_reader.c    2014-10-02 09:28:48.369242291 +0400
@@ -424,6 +424,11 @@ dvd_reader_t *DVDOpen( const char *ppath
      FILE *mntfile;
  #endif

+    const char *skip_guess = getenv("DVD_SKIP_DEVICE_GUESS");
+    if( skip_guess == NULL || strcmp(skip_guess,"1") != 0 )
+   {
+    fprintf( stderr, "libdvdread: Trying to guess device 
instead of path. You can define DVD_SKIP_DEVICE_GUESS=1 to 
change this behavior.\n");
+
      /* XXX: We should scream real loud here. */
      if( !(path_copy = strdup( path ) ) )
        goto DVDOpen_error;
@@ -592,9 +597,11 @@ dvd_reader_t *DVDOpen( const char *ppath
        free(path);
        return auth_drive;
      }
+   }
      /**
       * Otherwise, we now try to open the directory tree 
instead.
       */
+    fprintf( stderr, "libdvdread: Opening DVD by path...\n" );
      ret_val = DVDOpenPath( path );
        free( path );
        return ret_val;

It works:

$ DVD_SKIP_DEVICE_GUESS=1 vlc --play-and-exit dvd:// --dvd 
/media/cdrom/VIDEO_TS/
VLC media player 2.1.5 Rincewind (revision 2.1.4-49-gdab6cb5)
[0x90c3508] [http] lua interface: Lua HTTP interface
[0x90240d0] main libvlc: Running vlc with the default 
interface. Use 'cvlc' to use vlc without interface.
libdvdnav: Using dvdnav version 5.0.0
libdvdread: Opening DVD by path...
libdvdnav: DVD disk reports itself with Region mask 
0x00c00000. Regions: 1 2 3 4 5 6
...

... but I know it's not a best solution of this problem, and 
I hope that developers can fix this bug properly.


More information about the libdvdnav-devel mailing list