Improved pacifier with -rom_toc_scan

This commit is contained in:
Thomas Schmitt 2008-06-18 19:28:52 +00:00
parent 4de452fb94
commit a1968a431d
2 changed files with 21 additions and 12 deletions

View File

@ -1008,10 +1008,10 @@ int isoburn_read_iso_head(struct burn_drive *d, int lba,
int isoburn_emulate_toc(struct burn_drive *d, int flag) 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; int scan_start= 0, scan_count= 0;
struct isoburn *o; struct isoburn *o;
struct isoburn_toc_entry *item; struct isoburn_toc_entry *item;
char msg[160], *sev; char msg[160], size_text[80], *sev;
time_t start_time, last_pacifier, now; time_t start_time, last_pacifier, now;
/* is the media emulated multi-session ? */ /* is the media emulated multi-session ? */
@ -1032,6 +1032,17 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
lba= Libisoburn_overwriteable_starT; lba= Libisoburn_overwriteable_starT;
} }
while(lba<image_size || (flag&2)) { while(lba<image_size || (flag&2)) {
now= time(NULL);
if(now - last_pacifier >= 5) {
last_pacifier= now;
if(scan_count>=10*512)
sprintf(size_text, "%.f MB", ((double) scan_count) / 512.0);
else
sprintf(size_text, "%.f MB", 2 * (double) scan_count);
sprintf(msg, "Found %d ISO sessions by scanning %s in %.f seconds",
session_count, size_text, (double) (now - start_time));
isoburn_msgs_submit(o, 0x00060000, msg, 0, "UPDATE", 0);
}
read_flag= 0; read_flag= 0;
if(flag&2) if(flag&2)
read_flag= (1<<15)|((session_count>0)<<14); read_flag= (1<<15)|((session_count>0)<<14);
@ -1042,6 +1053,7 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
if(ret==0) { if(ret==0) {
/* try at next 64 k block (check both 32 k halves) */ /* try at next 64 k block (check both 32 k halves) */
lba+= 32; lba+= 32;
scan_count+= 32;
if(lba-scan_start <= Libisoburn_toc_scan_max_gaP) if(lba-scan_start <= Libisoburn_toc_scan_max_gaP)
continue; continue;
} }
@ -1070,13 +1082,6 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
item->track_no= session_count; item->track_no= session_count;
item->start_lba= lba; item->start_lba= lba;
item->track_blocks= track_blocks; item->track_blocks= track_blocks;
now= time(NULL);
if(now - last_pacifier > 5) {
last_pacifier= now;
sprintf(msg, "Scanning found %d ISO session headers in %.f seconds",
session_count, (double) (now - start_time));
isoburn_msgs_submit(o, 0x00060000, msg, 0, "UPDATE", 0);
}
lba+= track_blocks; lba+= track_blocks;
if(lba % Libisoburn_nwa_alignemenT) if(lba % Libisoburn_nwa_alignemenT)
lba+= Libisoburn_nwa_alignemenT - (lba % Libisoburn_nwa_alignemenT); lba+= Libisoburn_nwa_alignemenT - (lba % Libisoburn_nwa_alignemenT);
@ -1087,8 +1092,12 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
else else
sev= "DEBUG"; sev= "DEBUG";
now= time(NULL); now= time(NULL);
sprintf(msg, "Scanning found %d ISO session headers in %.f seconds", if(scan_count>=10*512)
session_count, (double) (now - start_time)); sprintf(size_text, "%.f MB", ((double) scan_count) / 512.0);
else
sprintf(size_text, "%.f MB", 2 * (double) scan_count);
sprintf(msg, "Found %d ISO sessions by scanning %s in %.f seconds",
session_count, size_text, (double) (now - start_time));
isoburn_msgs_submit(o, 0x00060000, msg, 0, sev, 0); isoburn_msgs_submit(o, 0x00060000, msg, 0, sev, 0);
return(1); return(1);
failure:; failure:;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.06.18.161723" #define Xorriso_timestamP "2008.06.18.192913"