Hi Erik,

We are evaluating using your github versions of dvdread and dvdnav in
handbrake.  So I've been having a close look at what patches you've
accepted and what's still missing.  I've got a few patches I'm going to
through at you.

The first was part of another patch that I submitted.  You merged the
rest but left this part out. 

It's purpose is to detect if an input path is a physical drive (on
windows), and if so attempt to open it as an image.  The current code
will only attempt to open the path as an image if the path contains no
directory components (e.g. "X:" or "X:\").  So if the path instead is
"X:\VIDEO_TS", it will fail to open it as an image and instead open it
as a directory tree and css decryption will not work. This makes the
behavior more similar to what happens on other platforms.


diff --git a/src/dvd_reader.c b/src/dvd_reader.c
index 27dc2cd..a6242b4 100644
--- a/src/dvd_reader.c
+++ b/src/dvd_reader.c
@@ -35,6 +35,7 @@
 
 /* misc win32 helpers */
 #ifdef WIN32
+#include <windows.h>
 #ifndef HAVE_GETTIMEOFDAY
 /* replacement gettimeofday implementation */
 #include <sys/timeb.h>
@@ -548,14 +549,17 @@ dvd_reader_t *DVDOpen( const char *ppath )
       }
       fclose( mntfile );
     }
-#elif defined(_WIN32) || defined(__OS2__)
-#ifdef __OS2__
+#elif defined(__OS2__)
     /* Use DVDOpenImageFile() only if it is a drive */
     if(isalpha(path[0]) && path[1] == ':' &&
         ( !path[2] ||
           ((path[2] == '\\' || path[2] == '/') && !path[3])))
-#endif
     auth_drive = DVDOpenImageFile( path, have_css );
+#elif defined(_WIN32)
+    if( GetDriveType( path_copy ) == DRIVE_CDROM ) {
+      path_copy[2] = '\0';
+      auth_drive = DVDOpenImageFile( path_copy, have_css );
+    }
 #endif
 
 #if !defined(_WIN32) && !defined(__OS2__)
_______________________________________________
DVDnav-discuss mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/dvdnav-discuss

Reply via email to