Sorry. What you have looks fine. Only thing I'd suggest is to add a MMC command equivalent which seems to be a READ_SUBCHANNEL command. And then used from the specific drivers (e.g lib/drivers/gnu_linux.c).
On a possibly unrelated topic. I jsut tried a "make test" and seem to have gotten an error in running test/check_fuzzyiso.sh: Sorry, could not find an ISO 9660 image from /src/external-cvs/libcdio/test/cdda.bin /. /.. /copying /doc Sorry, could not find an ISO 9660 image from /src/external-cvs/libcdio/test/p1.bin ./check_fuzzyiso.sh: failed running: /src/external-cvs/libcdio/test/../example/isofuzzy /src/external-cvs/libcdio/test/p1.bin FAIL: check_fuzzyiso.sh Haven't tried tracking this down. It may even just be that I need to try this on a clean checkout. Robert William Fuller writes: > Robert William Fuller wrote: > > cdrdao.c and bincue.c both save the ISRC codes. I have found the Nero > > ISRC codes as well. I have written the code to save the Nero ISRC > > codes. There's only one problem. Although cdrdao.c and bincue.c have > > been saving ISRC codes for a while, there's no API to access the ISRC > > codes! What do people think about the following API? > > > > char *cdio_get_track_isrc(CdIo_t *cd, track_t track); > > > > I'm guessing it should follow the pattern of cdio_get_mcn and strdup the > > string? > > All is unusually quiet. Is it a holiday? I'm going to take lack of > feedback as approval. You can always chastise me later and we can roll > back the changes :-) Note that we're down to only 7 unknown bytes in > Nero's DAOI/DAOX structure! Here's what's going in for ISRC: > > cvs diff: Diffing include/cdio > Index: include/cdio/track.h > =================================================================== > RCS file: /sources/libcdio/libcdio/include/cdio/track.h,v > retrieving revision 1.12 > diff -r1.12 track.h > 220a221,234 > > > > /*! > > Get the International Standard Recording Code (ISRC) for track number > > i_track in p_cdio. Track numbers usually start at something > > greater than 0, usually 1. > > > > @return the International Standard Recording Code (ISRC) or NULL > > if there is none or we don't have the ability to get it. > > > > Note: string is malloc'd so caller has to free() the returned > > string when done with it. > > > > */ > > char * cdio_get_track_isrc (const CdIo_t *p_cdio, track_t i_track); > cvs diff: Diffing lib/driver > Index: lib/driver/cdio_private.h > =================================================================== > RCS file: /sources/libcdio/libcdio/lib/driver/cdio_private.h,v > retrieving revision 1.32 > diff -r1.32 cdio_private.h > 269a270,278 > > > > /*! > > Return the International Standard Recording Code (ISRC) for > track number > > i_track in p_cdio. Track numbers start at 1. > > > > Note: string is malloc'd so caller has to free() the returned > > string when done with it. > > */ > > char * (*get_track_isrc) ( const CdIo_t *p_cdio, track_t i_track ); > Index: lib/driver/image_common.c > =================================================================== > RCS file: /sources/libcdio/libcdio/lib/driver/image_common.c,v > retrieving revision 1.13 > diff -r1.13 image_common.c > 273a274,293 > > Return the International Standard Recording Code (ISRC) for track > number > > i_track in p_cdio. Track numbers start at 1. > > > > Note: string is malloc'd so caller has to free() the returned > > string when done with it. > > */ > > char * > > get_track_isrc_image(const void *p_user_data, track_t i_track) > > { > > const _img_private_t *p_env = p_user_data; > > char *isrc = p_env->tocent[i_track-p_env->gen.i_first_track].isrc; > > > > if (isrc && isrc[0]) { > > return strdup(isrc); > > } else { > > return NULL; > > } > > } > > > > /*! > Index: lib/driver/image_common.h > =================================================================== > RCS file: /sources/libcdio/libcdio/lib/driver/image_common.h,v > retrieving revision 1.11 > diff -r1.11 image_common.h > 160a161,169 > > Return the International Standard Recording Code (ISRC) for track > number > > i_track in p_cdio. Track numbers start at 1. > > > > Note: string is malloc'd so caller has to free() the returned > > string when done with it. > > */ > > char *get_track_isrc_image(const void *p_user_data, track_t i_track); > > > > /*! > Index: lib/driver/libcdio.sym > =================================================================== > RCS file: /sources/libcdio/libcdio/lib/driver/libcdio.sym,v > retrieving revision 1.39 > diff -r1.39 libcdio.sym > 84a85 > > cdio_get_track_isrc > Index: lib/driver/track.c > =================================================================== > RCS file: /sources/libcdio/libcdio/lib/driver/track.c,v > retrieving revision 1.5 > diff -r1.5 track.c > 248a249,267 > > /*! > > Return the International Standard Recording Code (ISRC) for track > number > > i_track in p_cdio. Track numbers start at 1. > > > > Note: string is malloc'd so caller has to free() the returned > > string when done with it. > > */ > > char * > > cdio_get_track_isrc (const CdIo_t *p_cdio, track_t i_track) > > { > > if (p_cdio == NULL) return NULL; > > > > if (p_cdio->op.get_track_isrc) { > > return p_cdio->op.get_track_isrc (p_cdio->env, i_track); > > } else { > > return NULL; > > } > > } > > > cvs diff: Diffing lib/driver/image > Index: lib/driver/image/bincue.c > =================================================================== > RCS file: /sources/libcdio/libcdio/lib/driver/image/bincue.c,v > retrieving revision 1.21 > diff -r1.21 bincue.c > 1157,1158c1157,1158 > < _funcs.get_track_channels = get_track_channels_image, > < _funcs.get_track_copy_permit = get_track_copy_permit_image, > --- > > _funcs.get_track_channels = get_track_channels_image; > > _funcs.get_track_copy_permit = get_track_copy_permit_image; > 1163c1163 > < _funcs.get_track_preemphasis = get_track_preemphasis_image, > --- > > _funcs.get_track_preemphasis = get_track_preemphasis_image; > 1164a1165 > > _funcs.get_track_isrc = get_track_isrc_image; > Index: lib/driver/image/cdrdao.c > =================================================================== > RCS file: /sources/libcdio/libcdio/lib/driver/image/cdrdao.c,v > retrieving revision 1.25 > diff -r1.25 cdrdao.c > 1279,1280c1279,1280 > < _funcs.get_track_channels = get_track_channels_image, > < _funcs.get_track_copy_permit = get_track_copy_permit_image, > --- > > _funcs.get_track_channels = get_track_channels_image; > > _funcs.get_track_copy_permit = get_track_copy_permit_image; > 1285c1285 > < _funcs.get_track_preemphasis = get_track_preemphasis_image, > --- > > _funcs.get_track_preemphasis = get_track_preemphasis_image; > 1286a1287 > > _funcs.get_track_isrc = get_track_isrc_image; > Index: lib/driver/image/nrg.c > =================================================================== > RCS file: /sources/libcdio/libcdio/lib/driver/image/nrg.c,v > retrieving revision 1.25 > diff -r1.25 nrg.c > 376c376,377 > < _dao_common_t *_dao_common = (void *) chunk->data; > --- > > _dao_array_common_t *_dao_array_common = NULL; > > _dao_common_t *_dao_common = (void *) chunk->data; > 388c389 > < p_env->dtyp = _xentries->track_info[0].common.unknown[0]; > --- > > p_env->dtyp = _xentries->track_info[0].common.unknown[2]; > 391c392 > < p_env->dtyp = _ientries->track_info[0].common.unknown[0]; > --- > > p_env->dtyp = _ientries->track_info[0].common.unknown[2]; > 475a477,489 > > > > if (DAOX_ID == opcode) { > > _dao_array_common = &_xentries->track_info[i].common; > > } else { > > _dao_array_common = &_ientries->track_info[i].common; > > } > > p_env->tocent[i].isrc = calloc(1, CDIO_ISRC_SIZE+1); > > memcpy(p_env->tocent[i].isrc, _dao_array_common->psz_isrc, > CDIO_ISRC_SIZE); > > p_env->tocent[i].isrc[CDIO_ISRC_SIZE] = '\0'; > > if (p_env->tocent[i].isrc[0]) { > > cdio_info("nrg isrc has value \"%s\"", > p_env->tocent[i].isrc); > > } > > > 1265a1280 > > _funcs.get_track_isrc = get_track_isrc_image; > Index: lib/driver/image/nrg.h > =================================================================== > RCS file: /sources/libcdio/libcdio/lib/driver/image/nrg.h,v > retrieving revision 1.4 > diff -r1.4 nrg.h > 78,80c78,79 > < uint8_t zero[10]; > < uint32_t sector_size GNUC_PACKED; > < uint8_t unknown[4]; > --- > > char psz_isrc[CDIO_ISRC_SIZE]; > > uint8_t unknown[6]; > > >