Search
lxdream.org :: lxdream :: r1030:864417a57662
lxdream 0.9.1
released Jun 29
Download Now
changeset1030:864417a57662
parent1029:7138bbb9537c
child1031:a9938ed3bfe8
authornkeynes
dateMon Jun 22 01:13:16 2009 +0000 (11 years ago)
Fix disc type breakage introduced in last refactor
src/gdrom/cdi.c
src/gdrom/gddriver.h
src/gdrom/gdimage.c
src/gdrom/nrg.c
1.1 --- a/src/gdrom/cdi.c Sun Jun 14 21:46:05 2009 +0000
1.2 +++ b/src/gdrom/cdi.c Mon Jun 22 01:13:16 2009 +0000
1.3 @@ -203,5 +203,6 @@
1.4 fseek( f, 12, SEEK_CUR );
1.5 }
1.6 disc->track_count = total_tracks;
1.7 + gdrom_set_disc_type(disc);
1.8 return disc;
1.9 }
2.1 --- a/src/gdrom/gddriver.h Sun Jun 14 21:46:05 2009 +0000
2.2 +++ b/src/gdrom/gddriver.h Mon Jun 22 01:13:16 2009 +0000
2.3 @@ -258,4 +258,9 @@
2.4 */
2.5 void mmc_parse_toc2( gdrom_disc_t disc, unsigned char *buf );
2.6
2.7 +/**
2.8 + * Set the disc type flag based on the track contents
2.9 + */
2.10 +void gdrom_set_disc_type( gdrom_disc_t disc );
2.11 +
2.12 #endif /* !lxdream_gddriver_H */
3.1 --- a/src/gdrom/gdimage.c Sun Jun 14 21:46:05 2009 +0000
3.2 +++ b/src/gdrom/gdimage.c Mon Jun 22 01:13:16 2009 +0000
3.3 @@ -243,6 +243,24 @@
3.4 }
3.5 }
3.6
3.7 +void gdrom_set_disc_type( gdrom_disc_t disc )
3.8 +{
3.9 + int type = IDE_DISC_NONE, i;
3.10 + for( i=0; i<disc->track_count; i++ ) {
3.11 + if( disc->track[i].mode == GDROM_CDDA ) {
3.12 + if( type == IDE_DISC_NONE )
3.13 + type = IDE_DISC_AUDIO;
3.14 + } else if( disc->track[i].mode == GDROM_MODE1 || disc->track[i].mode == GDROM_RAW_NONXA ) {
3.15 + if( type != IDE_DISC_CDROMXA )
3.16 + type = IDE_DISC_CDROM;
3.17 + } else {
3.18 + type = IDE_DISC_CDROMXA;
3.19 + break;
3.20 + }
3.21 + }
3.22 + disc->disc_type = type;
3.23 +}
3.24 +
3.25 /**
3.26 * Determine the start position in a raw sector, and the amount of data to read
3.27 * in bytes, for a given combination of sector mode and read mode.
4.1 --- a/src/gdrom/nrg.c Sun Jun 14 21:46:05 2009 +0000
4.2 +++ b/src/gdrom/nrg.c Mon Jun 22 01:13:16 2009 +0000
4.3 @@ -343,6 +343,7 @@
4.4 }
4.5 } while( !end );
4.6 disc->track_count = track_id;
4.7 + gdrom_set_disc_type(disc);
4.8 return disc;
4.9 }
4.10
.