From ecc90928d33741dbe726b547f2d8322540c26ea0 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 8 Apr 2019 07:48:11 -0400 Subject: [PATCH] some useless change --- delay_manager.cpp | 4 +++- fec_manager.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/delay_manager.cpp b/delay_manager.cpp index 88eea49..fcb51b4 100644 --- a/delay_manager.cpp +++ b/delay_manager.cpp @@ -117,8 +117,10 @@ int delay_manager_t::check() if(!delay_mp.empty()) { const double m=1000*1000; + double timer_value=delay_mp.begin()->first/m -get_current_time_us()/m; // be aware of negative value, and be aware of uint + if(timer_value<0) timer_value=0; // set it to 0 if negative, although libev support negative value ev_timer_stop(loop, &timer); - ev_timer_set(&timer, delay_mp.begin()->first/m -get_current_time_us()/m,0 ); + ev_timer_set(&timer, timer_value,0 ); ev_timer_start(loop, &timer); } else diff --git a/fec_manager.cpp b/fec_manager.cpp index a175e7b..960e95e 100644 --- a/fec_manager.cpp +++ b/fec_manager.cpp @@ -186,8 +186,10 @@ int fec_encode_manager_t::append(char *s,int len/*,int &is_first_packet*/) { first_packet_time=get_current_time_us(); + const double m=1000*1000; + ev_timer_stop(loop, &timer); - ev_timer_set(&timer, fec_par.timeout/1000000.0 ,0 ); + ev_timer_set(&timer, fec_par.timeout/m,0 ); ev_timer_start(loop, &timer); } if(fec_par.mode==0)//for type 0 use blob