Made -rom_toc_scan work on closed DVD-R in a DVD-ROM drive

This commit is contained in:
Thomas Schmitt 2008-06-18 13:20:29 +00:00
parent 32e15b5432
commit ceca17e946
3 changed files with 29 additions and 6 deletions

View File

@ -23,6 +23,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <time.h>
#ifndef Xorriso_standalonE #ifndef Xorriso_standalonE
@ -985,7 +986,8 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
int scan_start= 0; int scan_start= 0;
struct isoburn *o; struct isoburn *o;
struct isoburn_toc_entry *item; 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 ? */ /* is the media emulated multi-session ? */
ret= isoburn_find_emulator(&o, d, 0); 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)) if(o->emulation_mode<=0 && !(flag&1))
return(0); return(0);
start_time= last_pacifier= time(NULL);
lba= 0; lba= 0;
if(!(flag&2)) { if(!(flag&2)) {
ret= isoburn_read_iso_head(d, lba, &image_size, NULL, 0); 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->start_lba= lba;
item->track_blocks= track_blocks; 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; 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);
scan_start= lba; scan_start= lba;
} }
sprintf(msg, if(last_pacifier != start_time)
"Chain of ISO session headers yielded %d sessions", session_count); sev= "UPDATE";
burn_msgs_submit(0x00060000, msg, 0, "DEBUG", NULL); 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); return(1);
failure:; failure:;
isoburn_toc_entry_destroy(&(o->toc), 1); isoburn_toc_entry_destroy(&(o->toc), 1);

View File

@ -369,8 +369,10 @@ struct isoburn_imgen_opts {
/* Maximum gap to be bridged during a outer TOC scan. Gaps appear between the /* 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. 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: /* Creating a chain of image headers which form a TOC:

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.06.17.170622" #define Xorriso_timestamP "2008.06.18.132057"