Producing on overwriteables a partial TOC up to first damaged superblock

This commit is contained in:
Thomas Schmitt 2008-07-26 07:51:42 +00:00
parent 9bc21d7c34
commit 8975ea87b0
2 changed files with 40 additions and 17 deletions

View File

@ -1029,6 +1029,30 @@ int isoburn_read_iso_head(struct burn_drive *d, int lba,
} }
int isoburn_make_toc_entry(struct isoburn *o, int *session_count, int lba,
int track_blocks, int flag)
{
int ret;
struct isoburn_toc_entry *item;
ret= isoburn_toc_entry_new(&item, o->toc, 0);
if(ret<=0) {
isoburn_msgs_submit(o, 0x00060000,
"Not enough memory for emulated TOC entry object",
0, "FATAL", 0);
return(-1);
}
if(o->toc==NULL)
o->toc= item;
(*session_count)++;
item->session= *session_count;
item->track_no= *session_count;
item->start_lba= lba;
item->track_blocks= track_blocks;
return(1);
}
/* @param flag bit0= allow unemulated media /* @param flag bit0= allow unemulated media
bit1= free scanning without enclosing LBA-0-header bit1= free scanning without enclosing LBA-0-header
@return -1 severe error, 0= no neat header chain, 1= credible chain read @return -1 severe error, 0= no neat header chain, 1= credible chain read
@ -1037,8 +1061,8 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
{ {
int ret, image_size= 0, lba, track_blocks, session_count= 0, read_flag= 0; int ret, image_size= 0, lba, track_blocks, session_count= 0, read_flag= 0;
int scan_start= 0, scan_count= 0, probe_minus_16= 0, growisofs_nwa; int scan_start= 0, scan_count= 0, probe_minus_16= 0, growisofs_nwa;
int with_enclosure= 0;
struct isoburn *o; struct isoburn *o;
struct isoburn_toc_entry *item;
char msg[160], size_text[80], *sev; char msg[160], size_text[80], *sev;
time_t start_time, last_pacifier, now; time_t start_time, last_pacifier, now;
@ -1058,6 +1082,7 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
if(ret<=0) if(ret<=0)
{ret= 0; goto failure;} {ret= 0; goto failure;}
lba= Libisoburn_overwriteable_starT; lba= Libisoburn_overwriteable_starT;
with_enclosure= 1;
} }
while(lba<image_size || (flag&2)) { while(lba<image_size || (flag&2)) {
now= time(NULL); now= time(NULL);
@ -1106,27 +1131,25 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
"Chain of ISO session headers broken at #%d, LBA %ds", "Chain of ISO session headers broken at #%d, LBA %ds",
session_count+1, lba); session_count+1, lba);
isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0); isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
if(with_enclosure) {
ret= isoburn_make_toc_entry(o, &session_count, 0, image_size, 0);
if(ret<=0)
goto failure;
}
break; /* do not return failure */
} }
{ret= 0; goto failure;} {ret= 0; goto failure;}
} }
if(ret==2) /* ISO header was found in first half block */ if(ret==2) /* ISO header was found in first half block */
lba-= 16; lba-= 16;
ret= isoburn_toc_entry_new(&item, o->toc, 0);
if(ret<=0) { ret= isoburn_make_toc_entry(o, &session_count, lba, track_blocks, 0);
isoburn_msgs_submit(o, 0x00060000, if(ret<=0)
"Not enough memory for emulated TOC entry object", goto failure;
0, "FATAL", 0);
ret= -1; goto failure;
}
if(o->toc==NULL)
o->toc= item;
session_count++;
scan_count+= 32;
item->session= session_count;
item->track_no= session_count;
item->start_lba= lba;
item->track_blocks= track_blocks;
lba+= track_blocks; lba+= track_blocks;
scan_count+= 32;
/* growisofs aligns to 16 rather than 32 */ /* growisofs aligns to 16 rather than 32 */
growisofs_nwa= lba; growisofs_nwa= lba;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.07.21.161826" #define Xorriso_timestamP "2008.07.26.075027"