Smoothened time estimation with pacifier mkisofs style

This commit is contained in:
Thomas Schmitt 2008-09-09 08:25:20 +00:00
parent 410d972188
commit 16f6de937e
2 changed files with 5 additions and 3 deletions

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.09.08.121548" #define Xorriso_timestamP "2008.09.09.082406"

View File

@ -1210,7 +1210,7 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
next_base_count= progress.sector; next_base_count= progress.sector;
} }
if(first_base_time > 0 && if(first_base_time > 0 &&
current_time - first_base_time >= 3 && current_time - first_base_time >= 10 &&
progress.sectors > first_base_count) { progress.sectors > first_base_count) {
norm= (1.0 - quot); norm= (1.0 - quot);
if(norm < 0.0001) if(norm < 0.0001)
@ -1224,7 +1224,7 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
norm= 1.0; norm= 1.0;
} }
if(base_time > 0 && if(base_time > 0 &&
current_time - base_time >= 3 && progress.sectors > base_count) { current_time - base_time >= 10 && progress.sectors > base_count) {
quot= ((double) progress.sector - base_count) quot= ((double) progress.sector - base_count)
/ ((double) progress.sectors - base_count); / ((double) progress.sectors - base_count);
time_prediction+= (1.0 - quot) / quot * (current_time - base_time); time_prediction+= (1.0 - quot) / quot * (current_time - base_time);
@ -1269,6 +1269,8 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
if(aborting<=0) if(aborting<=0)
aborting= Xorriso_check_burn_abort(xorriso, 0); aborting= Xorriso_check_burn_abort(xorriso, 0);
usleep(100000); usleep(100000);
if(((time_t) Sfile_microtime(0)) - ((time_t) current_time) >= 1)
break;
} }
} }
return(1); return(1);