From fdea98935a03b7a42a1e71380727a747197bf7c0 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 24 Sep 2008 15:55:26 +0000 Subject: [PATCH] Trying to get pacifiers of simultaneously running emulations into sync --- xorriso/xorriso_timestamp.h | 2 +- xorriso/xorrisoburn.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 7b60999a..90d666e8 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.09.20.093140" +#define Xorriso_timestamP "2008.09.24.155424" diff --git a/xorriso/xorrisoburn.c b/xorriso/xorrisoburn.c index b0f56c7b..d7d1bee0 100644 --- a/xorriso/xorrisoburn.c +++ b/xorriso/xorrisoburn.c @@ -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; } }