diff --git a/libmpdvdkit2/dvd_reader.c b/libmpdvdkit2/dvd_reader.c index d800ae654c..f33ebb7703 100644 --- a/libmpdvdkit2/dvd_reader.c +++ b/libmpdvdkit2/dvd_reader.c @@ -273,6 +273,16 @@ dvd_reader_t *DVDOpen( const char *path ) if( !path ) return 0; +#ifdef WIN32 + /* Stat doesn't work on devices under mingwin/cygwin. */ + if( path[0] && path[1] == ':' && path[2] == '\0' ) + { + /* Don't try to stat the file */ + fileinfo.st_mode = S_IFBLK; + } + else +#endif + { ret = stat( path, &fileinfo ); if( ret < 0 ) { /* If we can't stat the file, give up */ @@ -280,6 +290,7 @@ dvd_reader_t *DVDOpen( const char *path ) perror(""); return 0; } + } /* Try to open libdvdcss or fall back to standard functions */ have_css = DVDInputSetup();