[DVDnav-discuss] modification of read-raw-device.patch
John Stebbins
stebbins at jetheaddev.com
Fri Jul 30 09:07:03 CEST 2010
Looks right. But I can't test it right now. Well give it a test next week.
On 07/29/2010 08:19 PM, Erik Hovland wrote:
> --- 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>
> @@ -463,15 +464,22 @@ dvd_reader_t *DVDOpen( const char *ppath )
> #endif
> if( strlen( path_copy )> TITLES_MAX ) {
> if( !strcasecmp(&(path_copy[ strlen( path_copy ) - TITLES_MAX ]),
> - "/video_ts" ) ) {
> - path_copy[ strlen( path_copy ) - TITLES_MAX ] = '\0';
> + "/video_ts" ) )
> +#ifdef _WIN32
> + || ( !strcasecmp(&(path_copy[ strlen( path_copy ) - TITLES_MAX ]),
> + "\\video_ts" ) )
> +#endif
> + {
> + path_copy[ strlen( path_copy ) - (TITLES_MAX-1) ] = '\0';
> }
> }
>
> +#ifndef _WIN32
> if(path_copy[0] == '\0') {
> path_copy[0] = '/';
> path_copy[1] = '\0';
> }
> +#endif
>
> #if defined(SYS_BSD)
> if( ( fe = getfsfile( path_copy ) ) ) {
> @@ -523,7 +531,13 @@ dvd_reader_t *DVDOpen( const char *ppath )
> fclose( mntfile );
> }
> #elif defined(_WIN32) || defined(__OS2__)
> -#ifdef __OS2__
> +#if defined(_WIN32)
> + if( GetDriveTypeA( path_copy ) == DRIVE_CDROM ) {
> + path_copy[2] = '\0';
> + auth_drive = DVDOpenImageFile( path_copy, have_css );
> + dev_name = strdup( path_copy );
> + }
> +#elif defined(__OS2__)
> /* Use DVDOpenImageFile() only if it is a drive */
> if(isalpha(path[0])&& path[1] == ':'&&
> ( !path[2] ||
> @@ -532,7 +546,7 @@ dvd_reader_t *DVDOpen( const char *ppath )
> auth_drive = DVDOpenImageFile( path, have_css );
> #endif
>
> -#if !defined(_WIN32)&& !defined(__OS2__)
> +#if !defined(__OS2__)
> if( !dev_name ) {
> fprintf( stderr, "libdvdread: Couldn't find device name.\n" );
> } else if( !auth_drive ) {
>
>
More information about the DVDnav-discuss
mailing list