Create emulated toc entry for simple ISO session on overwriteable media

This commit is contained in:
Thomas Schmitt 2008-08-09 16:10:50 +00:00
parent 784684eb92
commit 1fd02ceba2
2 changed files with 25 additions and 10 deletions

View File

@ -380,15 +380,10 @@ int isoburn_drive_aquire(struct burn_drive_info *drive_infos[],
int ret, conv_ret, drive_grabbed= 0;
char libburn_drive_adr[BURN_DRIVE_ADR_LEN];
struct isoburn *o= NULL;
char msg[BURN_MSGS_MESSAGE_LEN+4096];
conv_ret= burn_drive_convert_fs_adr(adr, libburn_drive_adr);
if(conv_ret<=0) {
sprintf(msg, "Unsuitable drive address: '%s'\n",adr);
msg[BURN_MSGS_MESSAGE_LEN-1]= 0;
isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "FAILURE", 0);
ret= 0; goto ex;
}
if(conv_ret<=0)
strcpy(libburn_drive_adr, adr);
ret= burn_drive_scan_and_grab(drive_infos, libburn_drive_adr, flag&1);
if(ret<=0)
@ -1176,6 +1171,10 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
return(1);
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);
}
return(ret);
}
@ -1320,15 +1319,31 @@ failure:;
int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc)
{
struct isoburn_toc_entry *t;
int ret= 0;
int ret= 0, num_sessions, num_tracks;
struct burn_session **sessions;
struct burn_track **tracks;
struct burn_toc_entry entry;
if(disc==NULL)
return(0);
if(disc->toc!=NULL) {
for(t= disc->toc; t!=NULL; t= t->next)
ret= t->start_lba + t->track_blocks;
} else if(disc->disc!=NULL)
} else if(disc->disc!=NULL) {
sessions= burn_disc_get_sessions(disc->disc, &num_sessions);
if(num_sessions > 0) {
tracks = burn_session_get_tracks(sessions[num_sessions - 1],
&num_tracks);
if(num_tracks > 0) {
burn_track_get_entry(tracks[num_tracks - 1], &entry);
if(entry.extensions_valid & 1)
ret= entry.start_lba + entry.track_blocks;
}
}
/*
ret= burn_disc_get_sectors(disc->disc);
*/
}
return(ret);
}

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.08.09.160515"
#define Xorriso_timestamP "2008.08.09.160947"