Enabled speed display with command -extract

This commit is contained in:
Thomas Schmitt 2012-02-25 15:49:21 +00:00
parent 67836d9721
commit 661ae74800
4 changed files with 13 additions and 8 deletions

View File

@ -543,7 +543,7 @@ int Xorriso_option_extract(struct XorrisO *xorriso, char *iso_path,
if(!(flag&2)) if(!(flag&2))
Xorriso_pacifier_callback(xorriso, "files restored",xorriso->pacifier_count, Xorriso_pacifier_callback(xorriso, "files restored",xorriso->pacifier_count,
xorriso->pacifier_total, "", 1|4); xorriso->pacifier_total, "", 1 | 4 | 8 | 32);
if(ret <= 0 || problem_count > 0) if(ret <= 0 || problem_count > 0)
goto ex; goto ex;

View File

@ -596,7 +596,7 @@ int Xorriso_tree_restore_node(struct XorrisO *xorriso, IsoNode *node,
xorriso->pacifier_byte_count - last_p_count >= 128*1024) { xorriso->pacifier_byte_count - last_p_count >= 128*1024) {
Xorriso_pacifier_callback(xorriso, "files restored", Xorriso_pacifier_callback(xorriso, "files restored",
xorriso->pacifier_count, xorriso->pacifier_count,
xorriso->pacifier_total, "", 2|4); xorriso->pacifier_total, "", 2 | 4 | 8);
last_p_count= xorriso->pacifier_byte_count; last_p_count= xorriso->pacifier_byte_count;
} }
} }
@ -1044,7 +1044,7 @@ went_well:;
if(!(flag&2)) if(!(flag&2))
Xorriso_pacifier_callback(xorriso, "files restored", Xorriso_pacifier_callback(xorriso, "files restored",
xorriso->pacifier_count, xorriso->pacifier_count,
xorriso->pacifier_total, "", 4); xorriso->pacifier_total, "", 4 | 8);
ret= 1; ret= 1;
ex:; ex:;
if(split_parts!=NULL) if(split_parts!=NULL)

View File

@ -2020,6 +2020,7 @@ int Xorriso_pacifier_callback(struct XorrisO *xorriso, char *what_done,
double current_time, since, interval_time, speed, speed_factor; double current_time, since, interval_time, speed, speed_factor;
char count_text[80], byte_text[80], profile_name[80], *speed_unit; char count_text[80], byte_text[80], profile_name[80], *speed_unit;
int ret, profile_number; int ret, profile_number;
off_t amount;
current_time= Sfile_microtime(0); current_time= Sfile_microtime(0);
interval_time= current_time - xorriso->last_update_time; interval_time= current_time - xorriso->last_update_time;
@ -2056,13 +2057,17 @@ int Xorriso_pacifier_callback(struct XorrisO *xorriso, char *what_done,
(flag & (8 | 64)) ? "s" : "seconds"); (flag & (8 | 64)) ? "s" : "seconds");
} }
speed= -1.0; speed= -1.0;
if(flag & 4)
amount= xorriso->pacifier_byte_count;
else
amount= count;
if((flag & 8)) { if((flag & 8)) {
if(flag & 32) { if(flag & 32) {
if(since > 0) if(since > 0)
speed= count / since; speed= amount / since;
} else if(count >= xorriso->pacifier_prev_count) { } else if(amount >= xorriso->pacifier_prev_count) {
if(interval_time > 0) if(interval_time > 0)
speed= (count - xorriso->pacifier_prev_count) / interval_time; speed= (amount - xorriso->pacifier_prev_count) / interval_time;
} }
} }
if(speed >= 0.0) { if(speed >= 0.0) {
@ -2082,7 +2087,7 @@ int Xorriso_pacifier_callback(struct XorrisO *xorriso, char *what_done,
sprintf(xorriso->info_text+strlen(xorriso->info_text), " %s %.1fx%s", sprintf(xorriso->info_text+strlen(xorriso->info_text), " %s %.1fx%s",
(flag & 32 ? "=" : ","), speed / speed_factor, speed_unit); (flag & 32 ? "=" : ","), speed / speed_factor, speed_unit);
} }
xorriso->pacifier_prev_count= count; xorriso->pacifier_prev_count= amount;
if(current_object[0]!=0) if(current_object[0]!=0)
sprintf(xorriso->info_text+strlen(xorriso->info_text), sprintf(xorriso->info_text+strlen(xorriso->info_text),
", now at %s", current_object); ", now at %s", current_object);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2012.02.14.103256" #define Xorriso_timestamP "2012.02.25.154938"