From 7e24201e0789de8065e6b66a4572c31b2a848157 Mon Sep 17 00:00:00 2001 From: faust3 Date: Thu, 6 May 2004 18:04:06 +0000 Subject: [PATCH] Encrypted dvd playback now accepts -dvd-drive e: on mingw. fix from libdvdread, left out the various cosmetics changes for now git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12432 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdvdkit2/dvd_reader.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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();