|
|
|
@ -1054,13 +1054,14 @@ 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 track_blocks, char *volid, int flag)
|
|
|
|
|
{
|
|
|
|
|
int ret;
|
|
|
|
|
struct isoburn_toc_entry *item;
|
|
|
|
|
|
|
|
|
|
ret= isoburn_toc_entry_new(&item, o->toc, 0);
|
|
|
|
|
if(ret<=0) {
|
|
|
|
|
no_memory:;
|
|
|
|
|
isoburn_msgs_submit(o, 0x00060000,
|
|
|
|
|
"Not enough memory for emulated TOC entry object",
|
|
|
|
|
0, "FATAL", 0);
|
|
|
|
@ -1073,6 +1074,11 @@ int isoburn_make_toc_entry(struct isoburn *o, int *session_count, int lba,
|
|
|
|
|
item->track_no= *session_count;
|
|
|
|
|
item->start_lba= lba;
|
|
|
|
|
item->track_blocks= track_blocks;
|
|
|
|
|
if(volid != NULL) {
|
|
|
|
|
item->volid= strdup(volid);
|
|
|
|
|
if(item->volid == NULL)
|
|
|
|
|
goto no_memory;
|
|
|
|
|
}
|
|
|
|
|
return(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1087,7 +1093,7 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
|
|
|
|
|
int scan_start= 0, scan_count= 0, probe_minus_16= 0, growisofs_nwa;
|
|
|
|
|
int with_enclosure= 0;
|
|
|
|
|
struct isoburn *o;
|
|
|
|
|
char msg[160], size_text[80], *sev;
|
|
|
|
|
char msg[160], size_text[80], *sev, volid[33], *volid_pt= NULL;
|
|
|
|
|
time_t start_time, last_pacifier, now;
|
|
|
|
|
|
|
|
|
|
/* is the media emulated multi-session ? */
|
|
|
|
@ -1120,7 +1126,7 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
|
|
|
|
|
session_count, size_text, (double) (now - start_time));
|
|
|
|
|
isoburn_msgs_submit(o, 0x00060000, msg, 0, "UPDATE", 0);
|
|
|
|
|
}
|
|
|
|
|
read_flag= 0;
|
|
|
|
|
read_flag= 1;
|
|
|
|
|
if(flag&2)
|
|
|
|
|
read_flag|= (1<<15)|((session_count>0)<<14);
|
|
|
|
|
else {
|
|
|
|
@ -1138,8 +1144,11 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
|
|
|
|
|
probe_minus_16= 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ret= isoburn_read_iso_head(d, lba, &track_blocks, NULL, read_flag);
|
|
|
|
|
if(ret<=0) {
|
|
|
|
|
ret= isoburn_read_iso_head(d, lba, &track_blocks, volid, read_flag);
|
|
|
|
|
if(ret > 0) {
|
|
|
|
|
volid_pt= volid;
|
|
|
|
|
} else {
|
|
|
|
|
volid_pt= NULL;
|
|
|
|
|
if(session_count>0) {
|
|
|
|
|
if(flag&2) {
|
|
|
|
|
if(ret==0) {
|
|
|
|
@ -1157,7 +1166,7 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
|
|
|
|
|
isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
|
|
|
|
|
|
|
|
|
|
if(with_enclosure) {
|
|
|
|
|
ret= isoburn_make_toc_entry(o, &session_count, 0, image_size, 0);
|
|
|
|
|
ret= isoburn_make_toc_entry(o, &session_count, 0, image_size, NULL,0);
|
|
|
|
|
if(ret<=0)
|
|
|
|
|
goto failure;
|
|
|
|
|
}
|
|
|
|
@ -1169,7 +1178,8 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
|
|
|
|
|
if(ret==2) /* ISO header was found in first half block */
|
|
|
|
|
lba-= 16;
|
|
|
|
|
|
|
|
|
|
ret= isoburn_make_toc_entry(o, &session_count, lba, track_blocks, 0);
|
|
|
|
|
ret= isoburn_make_toc_entry(o, &session_count, lba, track_blocks, volid_pt,
|
|
|
|
|
0);
|
|
|
|
|
if(ret<=0)
|
|
|
|
|
goto failure;
|
|
|
|
|
lba+= track_blocks;
|
|
|
|
@ -1202,7 +1212,7 @@ failure:;
|
|
|
|
|
isoburn_toc_entry_destroy(&(o->toc), 1);
|
|
|
|
|
if(with_enclosure && o->emulation_mode == 1) {
|
|
|
|
|
session_count= 0;
|
|
|
|
|
ret= isoburn_make_toc_entry(o, &session_count, 0, image_size, 0);
|
|
|
|
|
ret= isoburn_make_toc_entry(o, &session_count, 0, image_size, NULL, 0);
|
|
|
|
|
}
|
|
|
|
|
return(ret);
|
|
|
|
|
}
|
|
|
|
@ -1475,6 +1485,21 @@ void isoburn_toc_track_get_entry(struct isoburn_toc_track *t,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int isoburn_toc_track_get_emul(struct isoburn_toc_track *t, int *start_lba,
|
|
|
|
|
int *image_blocks, char volid[33], int flag)
|
|
|
|
|
{
|
|
|
|
|
if(t->toc_entry == NULL)
|
|
|
|
|
return(0);
|
|
|
|
|
if(t->toc_entry->volid == NULL)
|
|
|
|
|
return(0);
|
|
|
|
|
*start_lba= t->toc_entry->start_lba;
|
|
|
|
|
*image_blocks= t->toc_entry->track_blocks;
|
|
|
|
|
strncpy(volid, t->toc_entry->volid, 32);
|
|
|
|
|
volid[32]= 0;
|
|
|
|
|
return(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void isoburn_toc_disc_free(struct isoburn_toc_disc *d)
|
|
|
|
|
{
|
|
|
|
|
if(d->disc!=NULL)
|
|
|
|
|