Mercurial > libdvdnav.hg
diff dvd_reader.c @ 176:4e099155c968 src
Helping with the WIN32 port.
| author | jcdutton |
|---|---|
| date | Mon, 28 Apr 2003 16:29:22 +0000 |
| parents | 68370b580980 |
| children | b0aa6f7931c0 |
line wrap: on
line diff
--- a/dvd_reader.c Mon Apr 28 15:32:19 2003 +0000 +++ b/dvd_reader.c Mon Apr 28 16:29:22 2003 +0000 @@ -51,6 +51,10 @@ #define DEFAULT_UDF_CACHE_LEVEL 1 +/**/ +#define WIN32_CSS 0 +/**/ + struct dvd_reader_s { /* Basic information. */ int isImageFile; @@ -296,13 +300,32 @@ dvd_reader_t *DVDOpen( const char *path ) { +#ifndef _MSC_VER struct stat fileinfo; - int ret, have_css; + int ret; +#endif /* _MSC_VER */ + + int have_css; + char *dev_name = 0; if( path == NULL ) return 0; +#ifdef _MSC_VER + +#ifdef WIN32_CSS + /* Try to open libdvdcss or fall back to standard functions */ + have_css = dvdinput_setup(); + + return DVDOpenImageFile( path, have_css ); +#else + /* Under Win32, we only try to open image files */ + return DVDOpenImageFile( path, DVDInputSetup() ); +#endif + +#else + ret = stat( path, &fileinfo ); if( ret < 0 ) { /* If we can't stat the file, give up */ @@ -446,6 +469,7 @@ */ return DVDOpenPath( path ); } +#endif /* _MSC_VER */ /* If it's none of the above, screw it. */ fprintf( stderr, "libdvdread: Could not open %s\n", path );
