Search
lxdream.org :: lxdream :: r453:20f9c11e69e5
lxdream 0.9.1
released Jun 29
Download Now
changeset453:20f9c11e69e5
parent452:48db4ac96899
child454:f6586b97813a
authornkeynes
dateSun Oct 21 05:20:15 2007 +0000 (12 years ago)
Add CDI V3.5 support
src/gdrom/cdi.c
1.1 --- a/src/gdrom/cdi.c Sun Oct 21 05:20:00 2007 +0000
1.2 +++ b/src/gdrom/cdi.c Sun Oct 21 05:20:15 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: cdi.c,v 1.7 2007-10-06 08:58:00 nkeynes Exp $
1.6 + * $Id: cdi.c,v 1.8 2007-10-21 05:20:15 nkeynes Exp $
1.7 *
1.8 * CDI CD-image file support
1.9 *
1.10 @@ -69,7 +69,8 @@
1.11 if( trail.header_offset >= len ||
1.12 trail.header_offset == 0 )
1.13 return FALSE;
1.14 - return trail.cdi_version == CDI_V2_ID || trail.cdi_version == CDI_V3_ID;
1.15 + return trail.cdi_version == CDI_V2_ID || trail.cdi_version == CDI_V3_ID ||
1.16 + trail.cdi_version == CDI_V35_ID;
1.17 }
1.18
1.19 gdrom_disc_t cdi_image_open( const gchar *filename, FILE *f )
1.20 @@ -91,12 +92,17 @@
1.21 if( trail.header_offset >= len ||
1.22 trail.header_offset == 0 )
1.23 return NULL;
1.24 +
1.25 + if( trail.cdi_version != CDI_V2_ID && trail.cdi_version != CDI_V3_ID &&
1.26 + trail.cdi_version != CDI_V35_ID ) {
1.27 + return NULL;
1.28 + }
1.29
1.30 - if( trail.cdi_version == CDI_V2_ID ) trail.cdi_version = 2;
1.31 - else if( trail.cdi_version == CDI_V3_ID ) trail.cdi_version = 3;
1.32 - else return NULL;
1.33 -
1.34 - fseek( f, trail.header_offset, SEEK_SET );
1.35 + if( trail.cdi_version == CDI_V35_ID ) {
1.36 + fseek( f, -trail.header_offset, SEEK_END );
1.37 + } else {
1.38 + fseek( f, trail.header_offset, SEEK_SET );
1.39 + }
1.40 fread( &session_count, sizeof(session_count), 1, f );
1.41
1.42 disc = gdrom_image_new(f);
.