1.1 --- a/src/gdrom/cdi.c Sat Oct 27 05:44:54 2007 +0000
1.2 +++ b/src/gdrom/cdi.c Wed Nov 07 11:45:53 2007 +0000
1.5 - * $Id: cdi.c,v 1.9 2007-10-27 05:44:54 nkeynes Exp $
1.6 + * $Id: cdi.c,v 1.10 2007-10-28 07:23:46 nkeynes Exp $
1.8 * CDI CD-image file support
1.12 disc = gdrom_image_new(filename, f);
1.13 if( disc == NULL ) {
1.15 ERROR("Unable to allocate memory!");
1.19 fread( &track_count, sizeof(track_count), 1, f );
1.20 if( track_count + total_tracks > 99 ) {
1.21 ERROR( "Invalid number of tracks, bad cdi image\n" );
1.22 - disc->close(disc);
1.23 + gdrom_image_destroy_no_close(disc);
1.26 for( j=0; j<track_count; j++ ) {
1.28 fread( marker, 20, 1, f );
1.29 if( memcmp( marker, TRACK_START_MARKER, 20) != 0 ) {
1.30 ERROR( "Track start marker not found, error reading cdi image\n" );
1.31 - disc->close(disc);
1.32 + gdrom_image_destroy_no_close(disc);
1.35 fseek( f, 4, SEEK_CUR );
1.37 image->track[total_tracks].flags = 0x01;
1.38 if( trk.sector_size != 2 ) {
1.39 ERROR( "Invalid combination of mode %d with size %d", trk.mode, trk.sector_size );
1.40 - disc->close(disc);
1.41 + gdrom_image_destroy_no_close(disc);
1.46 image->track[total_tracks].flags = 0x41;
1.47 if( trk.sector_size != 0 ) {
1.48 ERROR( "Invalid combination of mode %d with size %d", trk.mode, trk.sector_size );
1.49 - disc->close(disc);
1.50 + gdrom_image_destroy_no_close(disc);
1.54 @@ -176,13 +175,13 @@
1.57 ERROR( "Invalid combination of mode %d with size %d", trk.mode, trk.sector_size );
1.58 - disc->close(disc);
1.59 + gdrom_image_destroy_no_close(disc);
1.64 ERROR( "Unsupported track mode %d", trk.mode );
1.65 - disc->close(disc);
1.66 + gdrom_image_destroy_no_close(disc);
1.69 image->track[total_tracks].offset = posn +
1.70 @@ -191,11 +190,12 @@
1.72 fread( marker, 1, 9, f );
1.73 if( memcmp( marker, EXT_MARKER, 9 ) == 0 ) {
1.74 - fseek( f, 91, SEEK_CUR );
1.75 + fseek( f, 79, SEEK_CUR );
1.77 - fseek( f, 3, SEEK_CUR );
1.78 + fseek( f, -9, SEEK_CUR );
1.81 + fseek( f, 12, SEEK_CUR );
1.83 image->track_count = total_tracks;