From ceca17e946c37d8645d0c2c8bb1bfc4f4c2741bf Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 18 Jun 2008 13:20:29 +0000 Subject: [PATCH] Made -rom_toc_scan work on closed DVD-R in a DVD-ROM drive --- libisoburn/burn_wrap.c | 29 +++++++++++++++++++++++++---- libisoburn/isoburn.h | 4 +++- xorriso/xorriso_timestamp.h | 2 +- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/libisoburn/burn_wrap.c b/libisoburn/burn_wrap.c index f7e579b3..e1799d8f 100644 --- a/libisoburn/burn_wrap.c +++ b/libisoburn/burn_wrap.c @@ -23,6 +23,7 @@ #include #include #include +#include #ifndef Xorriso_standalonE @@ -985,7 +986,8 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag) int scan_start= 0; struct isoburn *o; struct isoburn_toc_entry *item; - char msg[160]; + char msg[160], *sev; + time_t start_time, last_pacifier, now; /* is the media emulated multi-session ? */ ret= isoburn_find_emulator(&o, d, 0); @@ -996,6 +998,7 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag) if(o->emulation_mode<=0 && !(flag&1)) return(0); + start_time= last_pacifier= time(NULL); lba= 0; if(!(flag&2)) { ret= isoburn_read_iso_head(d, lba, &image_size, NULL, 0); @@ -1043,14 +1046,32 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag) item->start_lba= lba; item->track_blocks= track_blocks; + now= time(NULL); +#ifdef Not_yeT + + /* >>> need asynchronous delivery of messages */; + + 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)); + burn_msgs_submit(0x00060000, msg, 0, "UPDATE", NULL); + } +#endif + lba+= track_blocks; if(lba % Libisoburn_nwa_alignemenT) lba+= Libisoburn_nwa_alignemenT - (lba % Libisoburn_nwa_alignemenT); scan_start= lba; } - sprintf(msg, - "Chain of ISO session headers yielded %d sessions", session_count); - burn_msgs_submit(0x00060000, msg, 0, "DEBUG", NULL); + if(last_pacifier != start_time) + sev= "UPDATE"; + else + sev= "DEBUG"; + now= time(NULL); + sprintf(msg, "Scanning found %d ISO session headers in %.f seconds", + session_count, (double) (now - start_time)); + burn_msgs_submit(0x00060000, msg, 0, sev, NULL); return(1); failure:; isoburn_toc_entry_destroy(&(o->toc), 1); diff --git a/libisoburn/isoburn.h b/libisoburn/isoburn.h index 129507a7..8f018162 100644 --- a/libisoburn/isoburn.h +++ b/libisoburn/isoburn.h @@ -369,8 +369,10 @@ struct isoburn_imgen_opts { /* Maximum gap to be bridged during a outer TOC scan. Gaps appear between the end of a session and the start of the next session. + The longest gap found so far was about 38100 after the first session of a + DVD-R. */ -#define Libisoburn_toc_scan_max_gaP 8192 +#define Libisoburn_toc_scan_max_gaP 65536 /* Creating a chain of image headers which form a TOC: diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 69cf4b99..0135c050 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.06.17.170622" +#define Xorriso_timestamP "2008.06.18.132057"