New option -pacifier, more compatible pacifier with -as mkisofs
This commit is contained in:
@ -1096,7 +1096,8 @@ int Xorriso_check_burn_abort(struct XorrisO *xorriso, int flag)
|
||||
It issues pacifying update messages to the user.
|
||||
@param flag bit0-3 = emulation mode
|
||||
0= xorriso
|
||||
1= cdrskin
|
||||
1= cdrecord
|
||||
2= mkisofs
|
||||
bit4= report speed in CD units
|
||||
*/
|
||||
int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
|
||||
@ -1104,16 +1105,19 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
|
||||
{
|
||||
int ret, size, free_bytes, i, aborting= 0, emul, buffer_fill= 50, last_sector;
|
||||
struct burn_progress progress;
|
||||
char *status_text;
|
||||
char *status_text, date_text[80];
|
||||
enum burn_drive_status drive_status;
|
||||
double start_time, current_time, last_time;
|
||||
double measured_speed, speed_factor= 1385000;
|
||||
double measured_speed, speed_factor= 1385000, quot;
|
||||
time_t time_prediction;
|
||||
|
||||
start_time= Sfile_microtime(0);
|
||||
while(burn_drive_get_status(drive, NULL) == BURN_DRIVE_SPAWNING)
|
||||
usleep(100002);
|
||||
|
||||
emul= flag&15;
|
||||
if(emul==0)
|
||||
emul= xorriso->pacifier_style;
|
||||
if(flag&16)
|
||||
speed_factor= 150.0*1024;
|
||||
progress.sector= 0;
|
||||
@ -1134,14 +1138,15 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
|
||||
sprintf(xorriso->info_text, "%4d MB written",
|
||||
progress.sector / 512);
|
||||
|
||||
if(xorriso->pacifier_fifo!=NULL) {
|
||||
if(xorriso->pacifier_fifo!=NULL)
|
||||
ret= burn_fifo_inquire_status(xorriso->pacifier_fifo,
|
||||
&size, &free_bytes, &status_text);
|
||||
if(ret>0 )
|
||||
sprintf(xorriso->info_text+strlen(xorriso->info_text),
|
||||
" (fifo %2d%%)",
|
||||
(int) (100.0-100.0*((double) free_bytes)/(double) size));
|
||||
}
|
||||
else
|
||||
ret= isoburn_get_fifo_status(drive, &size, &free_bytes, &status_text);
|
||||
if(ret>0 )
|
||||
sprintf(xorriso->info_text+strlen(xorriso->info_text),
|
||||
" (fifo %2d%%)",
|
||||
(int) (100.0-100.0*((double) free_bytes)/(double) size));
|
||||
|
||||
buffer_fill= 50;
|
||||
if(progress.buffer_capacity>0)
|
||||
@ -1158,6 +1163,19 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
|
||||
measured_speed/speed_factor);
|
||||
}
|
||||
|
||||
} else if(emul == 2 &&
|
||||
progress.sectors > 0 && progress.sector <= progress.sectors) {
|
||||
/* "37.87% done, estimate finish Tue Jul 15 18:55:07 2008" */
|
||||
|
||||
quot= ((double) progress.sector) / ((double) progress.sectors);
|
||||
sprintf(xorriso->info_text, " %2.2f%% done", quot*100.0);
|
||||
if(current_time - start_time >= 2 && quot >= 0.02) {
|
||||
time_prediction= current_time +
|
||||
(1.0 - quot) / quot * (current_time-start_time) + 1;
|
||||
Ftimetxt(time_prediction, date_text, 4);
|
||||
sprintf(xorriso->info_text+strlen(xorriso->info_text),
|
||||
", estimate finish %s", date_text);
|
||||
}
|
||||
} else {
|
||||
if(progress.sector<=progress.sectors)
|
||||
sprintf(xorriso->info_text, "Writing: sector %d of %d",
|
||||
|
Reference in New Issue
Block a user