Trying to get pacifiers of simultaneously running emulations into sync

This commit is contained in:
Thomas Schmitt 2008-09-24 15:55:26 +00:00
parent 6cffccc0ef
commit 30ed274ea9
2 changed files with 7 additions and 4 deletions

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.09.20.093140"
#define Xorriso_timestamP "2008.09.24.155424"

View File

@ -1144,7 +1144,7 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
enum burn_drive_status drive_status;
double start_time, current_time, last_time, base_time= 0.0, base_count= 0.0;
double next_base_time= 0.0, next_base_count= 0.0, first_base_time= 0.0;
double first_base_count= 0.0, norm= 0.0;
double first_base_count= 0.0, norm= 0.0, now_time, fract_offset= 0.0;
double measured_speed, speed_factor= 1385000, quot;
time_t time_prediction;
@ -1153,6 +1153,7 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
usleep(100002);
emul= flag&15;
fract_offset= 0.2 * (double) emul - ((int) (0.2 * (double) emul));
if(emul==0)
emul= xorriso->pacifier_style;
if(flag&16)
@ -1272,12 +1273,14 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
current_time-start_time);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0);
for(i= 0; i<10; i++) {
for(i= 0; i<12; i++) { /* 2 usleeps more than supposed to be needed */
Xorriso_process_msg_queues(xorriso, 0);
if(aborting<=0)
aborting= Xorriso_check_burn_abort(xorriso, 0);
usleep(100000);
if(((time_t) Sfile_microtime(0)) - ((time_t) current_time) >= 1)
now_time= Sfile_microtime(0);
if(((time_t) now_time) - ((time_t) current_time) >= 1 &&
now_time - ((time_t) now_time) >= fract_offset)
break;
}
}