Issueing pacifier messages from within isoburn_set_msc1()

This commit is contained in:
Thomas Schmitt 2009-04-25 16:28:48 +00:00
parent 63d7cb7a7a
commit a3360d81a2
2 changed files with 20 additions and 2 deletions

View File

@ -1549,7 +1549,8 @@ int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value,
int flag)
{
int ret, num_sessions, num_tracks, adr_num, i, j, total_tracks;
int lba, best_lba, size, re_valid= 0;
int lba, best_lba, size, re_valid= 0, track_count= 0;
time_t start_time= 0, last_pacifier= 0, now;
char volid[33], msg[160];
struct isoburn *o;
struct isoburn_toc_disc *disc= NULL;
@ -1566,6 +1567,7 @@ int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value,
if(o==NULL)
return(-1);
start_time= last_pacifier= time(NULL);
adr_num= atoi(adr_value);
if(adr_mode!=3 || (flag & 2)) {
disc= isoburn_toc_drive_get_disc(d);
@ -1639,6 +1641,15 @@ not_found:;
if(tracks==NULL)
continue;
for(j= 0; j<num_tracks; j++) {
now= time(NULL);
if(now - last_pacifier >= 5 && track_count > 0) {
last_pacifier= now;
sprintf(msg,
"Scanned %d tracks for matching volid in %.f seconds",
track_count, (double) (now - start_time));
isoburn_msgs_submit(o, 0x00060000, msg, 0, "UPDATE", 0);
}
track_count++;
ret= isoburn_toc_track_get_emul(tracks[0], &lba, &size, volid, 0);
if(ret < 0)
continue;
@ -1671,6 +1682,13 @@ unknown_mode:;
}
ret= 1;
ex:;
if(start_time != last_pacifier && track_count > 0) {
now= time(NULL);
sprintf(msg,
"Scanned %d tracks for matching volid in %.f seconds",
track_count, (double) (now - start_time));
isoburn_msgs_submit(o, 0x00060000, msg, 0, "UPDATE", 0);
}
if(disc!=NULL)
isoburn_toc_disc_free(disc);
if((flag & 4) && re_valid)

View File

@ -1 +1 @@
#define Xorriso_timestamP "2009.04.25.162210"
#define Xorriso_timestamP "2009.04.25.162858"