hb_dvd_t * e;
hb_dvdread_t * d;
int region_mask;
+ char * path_ccp;
e = calloc( sizeof( hb_dvd_t ), 1 );
d = &(e->dvdread);
+ /*
+ * Convert UTF-8 path to current code page on Windows
+ * hb_utf8_to_cp() is the same as strdup on non-Windows,
+ * so no #ifdef required here
+ */
+ path_ccp = hb_utf8_to_cp( path );
+
/* Log DVD drive region code */
- if ( hb_dvd_region( path, ®ion_mask ) == 0 )
+ if ( hb_dvd_region( path_ccp, ®ion_mask ) == 0 )
{
hb_log( "dvd: Region mask 0x%02x", region_mask );
if ( region_mask == 0xFF )
}
/* Open device */
- if( !( d->reader = DVDOpen( path ) ) )
+ if( !( d->reader = DVDOpen( path_ccp ) ) )
{
/*
* Not an error, may be a stream - which we'll try in a moment.
goto fail;
}
- d->path = strdup( path );
+ d->path = strdup( path ); /* hb_dvdread_title_scan assumes UTF-8 path, so not path_ccp here */
+ free( path_ccp );
return e;
if( d->vmg ) ifoClose( d->vmg );
if( d->reader ) DVDClose( d->reader );
free( e );
+ free( path_ccp );
return NULL;
}
**********************************************************************/
static int hb_dvdnav_reset( hb_dvdnav_t * d )
{
+ char * path_ccp = hb_utf8_to_cp( d->path );
if ( d->dvdnav )
dvdnav_close( d->dvdnav );
/* Open device */
- if( dvdnav_open(&d->dvdnav, d->path) != DVDNAV_STATUS_OK )
+ if( dvdnav_open(&d->dvdnav, path_ccp) != DVDNAV_STATUS_OK )
{
/*
* Not an error, may be a stream - which we'll try in a moment.
dvdnav_err_to_string(d->dvdnav));
goto fail;
}
+
+ free( path_ccp );
+
return 1;
fail:
if( d->dvdnav ) dvdnav_close( d->dvdnav );
+ free( path_ccp );
return 0;
}
hb_dvd_t * e;
hb_dvdnav_t * d;
int region_mask;
+ char * path_ccp;
e = calloc( sizeof( hb_dvd_t ), 1 );
d = &(e->dvdnav);
+ /*
+ * Convert UTF-8 path to current code page on Windows
+ * hb_utf8_to_cp() is the same as strdup on non-Windows,
+ * so no #ifdef required here
+ */
+ path_ccp = hb_utf8_to_cp( path );
+
/* Log DVD drive region code */
- if ( hb_dvd_region( path, ®ion_mask ) == 0 )
+ if ( hb_dvd_region( path_ccp, ®ion_mask ) == 0 )
{
hb_log( "dvd: Region mask 0x%02x", region_mask );
if ( region_mask == 0xFF )
}
/* Open device */
- if( dvdnav_open(&d->dvdnav, path) != DVDNAV_STATUS_OK )
+ if( dvdnav_open(&d->dvdnav, path_ccp) != DVDNAV_STATUS_OK )
{
/*
* Not an error, may be a stream - which we'll try in a moment.
}
/* Open device */
- if( !( d->reader = DVDOpen( path ) ) )
+ if( !( d->reader = DVDOpen( path_ccp ) ) )
{
/*
* Not an error, may be a stream - which we'll try in a moment.
goto fail;
}
- d->path = strdup( path );
+ d->path = strdup( path ); /* hb_dvdnav_title_scan assumes UTF-8 path, so not path_ccp here */
+ free( path_ccp );
return e;
if( d->vmg ) ifoClose( d->vmg );
if( d->reader ) DVDClose( d->reader );
free( e );
+ free( path_ccp );
return NULL;
}