Mercurial > libdvdread4.hg
comparison dvd_reader.c @ 41:ef679522d00f src
replaced conditional checks on MSC with _WIN32 to permit MINGW to mount and decrypt images; patch by John Stebbins (stebbing jetheaddev com)
| author | nicodvb |
|---|---|
| date | Tue, 04 Aug 2009 21:21:49 +0000 |
| parents | 9f1804080f76 |
| children | 3aa39a1cff0f |
comparison
equal
deleted
inserted
replaced
| 40:ce7056d60f01 | 41:ef679522d00f |
|---|---|
| 331 int ret, have_css, retval, cdir = 0; | 331 int ret, have_css, retval, cdir = 0; |
| 332 dvd_reader_t *ret_val = NULL; | 332 dvd_reader_t *ret_val = NULL; |
| 333 char *dev_name = NULL; | 333 char *dev_name = NULL; |
| 334 char *path = NULL, *new_path = NULL, *path_copy = NULL; | 334 char *path = NULL, *new_path = NULL, *path_copy = NULL; |
| 335 | 335 |
| 336 #ifdef _MSC_VER | 336 #ifdef _WIN32 |
| 337 int len; | 337 int len; |
| 338 #endif | 338 #endif |
| 339 | 339 |
| 340 if( ppath == NULL ) | 340 if( ppath == NULL ) |
| 341 goto DVDOpen_error; | 341 goto DVDOpen_error; |
| 345 goto DVDOpen_error; | 345 goto DVDOpen_error; |
| 346 | 346 |
| 347 /* Try to open libdvdcss or fall back to standard functions */ | 347 /* Try to open libdvdcss or fall back to standard functions */ |
| 348 have_css = dvdinput_setup(); | 348 have_css = dvdinput_setup(); |
| 349 | 349 |
| 350 #ifdef _MSC_VER | 350 #ifdef _WIN32 |
| 351 /* Strip off the trailing \ if it is not a drive */ | 351 /* Strip off the trailing \ if it is not a drive */ |
| 352 len = strlen(path); | 352 len = strlen(path); |
| 353 if ((len > 1) && | 353 if ((len > 1) && |
| 354 (path[len - 1] == '\\') && | 354 (path[len - 1] == '\\') && |
| 355 (path[len - 2] != ':')) | 355 (path[len - 2] != ':')) |
| 504 break; | 504 break; |
| 505 } | 505 } |
| 506 } | 506 } |
| 507 fclose( mntfile ); | 507 fclose( mntfile ); |
| 508 } | 508 } |
| 509 #elif defined(_MSC_VER) || defined(__OS2__) | 509 #elif defined(_WIN32) || defined(__OS2__) |
| 510 auth_drive = DVDOpenImageFile( path, have_css ); | 510 auth_drive = DVDOpenImageFile( path, have_css ); |
| 511 #endif | 511 #endif |
| 512 | 512 |
| 513 #if !defined(_MSC_VER) && !defined(__OS2__) | 513 #if !defined(_WIN32) && !defined(__OS2__) |
| 514 if( !dev_name ) { | 514 if( !dev_name ) { |
| 515 fprintf( stderr, "libdvdread: Couldn't find device name.\n" ); | 515 fprintf( stderr, "libdvdread: Couldn't find device name.\n" ); |
| 516 } else if( !auth_drive ) { | 516 } else if( !auth_drive ) { |
| 517 fprintf( stderr, "libdvdread: Device %s inaccessible, " | 517 fprintf( stderr, "libdvdread: Device %s inaccessible, " |
| 518 "CSS authentication not available.\n", dev_name ); | 518 "CSS authentication not available.\n", dev_name ); |
