From 8bb8a24b29d234b67b50a9ab7e79f8933e83b0b3 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 9 Aug 2008 16:10:50 +0000 Subject: [PATCH] Create emulated toc entry for simple ISO session on overwriteable media --- libisoburn/trunk/libisoburn/burn_wrap.c | 33 ++++++++++++++------ libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/libisoburn/trunk/libisoburn/burn_wrap.c b/libisoburn/trunk/libisoburn/burn_wrap.c index af4a11eb..9959547d 100644 --- a/libisoburn/trunk/libisoburn/burn_wrap.c +++ b/libisoburn/trunk/libisoburn/burn_wrap.c @@ -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); } diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index d38f6515..2ea4ae8e 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.08.09.160515" +#define Xorriso_timestamP "2008.08.09.160947"