From 0c6ab93875e558c185f5dab9936582d09d939588 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 29 Sep 2007 22:18:34 +0000 Subject: [PATCH] Added optional code for a pseudo CD-RW to test the code for MMC multi-session --- src/burn_wrap.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/burn_wrap.c b/src/burn_wrap.c index c147a01d..983eb67e 100644 --- a/src/burn_wrap.c +++ b/src/burn_wrap.c @@ -9,6 +9,12 @@ Copyright 2007 Thomas Schmitt, */ +/* <<< A70929 : hardcoded CD-RW with fabricated -msinfo = 0,1600 +#define Hardcoded_cd_rW 1 +#define Hardcoded_cd_rw_c1 0 +#define Hardcoded_cd_rw_nwA 1600 +*/ + #include #include @@ -60,6 +66,14 @@ static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d, ret= isoburn_create_data_source(*o); if(ret<=0) goto ex; + +#ifdef Hardcoded_cd_rW + /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */ + caps->start_adr= 0; + (*o)->fabricated_disc_status= BURN_DISC_APPENDABLE; + /* is not set with MMC multi-session: (*o)->nwa= Hardcoded_cd_rw_nwA; */ +#endif + if(caps->start_adr) { /* set emulation to overwriteable */ (*o)->emulation_mode= 1; ret= isoburn_start_emulation(*o, 0); @@ -214,6 +228,12 @@ int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba) int ret; struct isoburn *o; +#ifdef Hardcoded_cd_rW + /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */ + *start_lba= Hardcoded_cd_rw_c1; + return(1); +#endif + if(isoburn_disc_get_status(d)!=BURN_DISC_APPENDABLE) return(0); ret= isoburn_find_emulator(&o, d, 0); @@ -234,6 +254,13 @@ int isoburn_disc_track_lba_nwa(struct burn_drive *d, int ret; struct isoburn *o; +#ifdef Hardcoded_cd_rW + /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */ + *lba= Hardcoded_cd_rw_c1; + *nwa= Hardcoded_cd_rw_nwA; + return(1); +#endif + ret= isoburn_find_emulator(&o, d, 0); if(ret<0) return(0); @@ -264,6 +291,13 @@ void isoburn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc) } } burn_write_opts_set_multi(opts, multi); + +#ifdef Hardcoded_cd_rW + /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */ + burn_write_opts_set_start_byte(opts, + ((off_t) Hardcoded_cd_rw_nwA) * (off_t) 2048); +#endif + burn_disc_write(opts, disc); }