just commit

This commit is contained in:
wangyu- 2017-10-18 07:37:40 -05:00
parent a5c26c5814
commit 67e2ed7457
3 changed files with 14 additions and 6 deletions

View File

@ -413,7 +413,7 @@ int fec_encode_manager_t::input(char *s,int len/*,int &is_first_packet*/)
int input_buf_idx=counter-1; int input_buf_idx=counter-1;
assert(ready_for_output==0); assert(ready_for_output==0);
ready_for_output=1; ready_for_output=1;
first_packet_time_for_output=0; //first_packet_time_for_output=0;
output_n=1; output_n=1;
int tmp_idx=0; int tmp_idx=0;

View File

@ -134,6 +134,10 @@ public:
return first_packet_time_for_output; return first_packet_time_for_output;
} }
int get_type()
{
return type;
}
u64_t get_timer_fd64(); u64_t get_timer_fd64();
int re_init(int data_num,int redundant_num,int mtu,int pending_num,int pending_time,int type); int re_init(int data_num,int redundant_num,int mtu,int pending_num,int pending_time,int type);
int input(char *s,int len/*,int &is_first_packet*/); int input(char *s,int len/*,int &is_first_packet*/);

View File

@ -190,15 +190,19 @@ int from_normal_to_fec(conn_info_t & conn_info,char *data,int len,int & out_n,ch
my_time_t common_latency=0; my_time_t common_latency=0;
my_time_t first_packet_time=conn_info.fec_encode_manager.get_first_packet_time(); my_time_t first_packet_time=conn_info.fec_encode_manager.get_first_packet_time();
if(fix_latency==1&&first_packet_time!=0) if(fix_latency==1&&conn_info.fec_encode_manager.get_type()==0&&first_packet_time!=0)
{ {
my_time_t current_time=get_current_time_us(); my_time_t current_time=get_current_time_us();
my_time_t tmp; my_time_t tmp;
if((my_time_t)fec_pending_time >=(current_time - first_packet_time)) if((my_time_t)fec_pending_time >=(current_time - first_packet_time))
{ {
tmp=(my_time_t)fec_pending_time-(current_time - first_packet_time); tmp=(my_time_t)fec_pending_time-(current_time - first_packet_time);
mylog(log_info,"delay=%llu\n",tmp);
}
else
{
tmp=0;
} }
else tmp=0;
common_latency+=tmp; common_latency+=tmp;
} }
@ -1219,7 +1223,7 @@ void process_arg(int argc, char *argv[])
{"mtu", required_argument, 0, 1}, {"mtu", required_argument, 0, 1},
{"mode", required_argument, 0,1}, {"mode", required_argument, 0,1},
{"timeout", required_argument, 0,1}, {"timeout", required_argument, 0,1},
{"--decode-buf", required_argument, 0,1}, {"decode-buf", required_argument, 0,1},
{"queue-len", required_argument, 0,'q'}, {"queue-len", required_argument, 0,'q'},
{"fec", required_argument, 0,'f'}, {"fec", required_argument, 0,'f'},
{"jitter", required_argument, 0,'j'}, {"jitter", required_argument, 0,'j'},
@ -1498,9 +1502,9 @@ void process_arg(int argc, char *argv[])
else if(strcmp(long_options[option_index].name,"decode-buf")==0) else if(strcmp(long_options[option_index].name,"decode-buf")==0)
{ {
sscanf(optarg,"%d",&fec_buff_num); sscanf(optarg,"%d",&fec_buff_num);
if(fec_buff_num<100 || fec_buff_num>20000) if(fec_buff_num<300 || fec_buff_num>20000)
{ {
mylog(log_fatal,"decode-buf value must be between 100 and 20000 (kbyte) \n"); mylog(log_fatal,"decode-buf value must be between 300 and 20000 (kbyte) \n");
myexit(-1); myexit(-1);
} }
mylog(log_info,"decode-buf=%d\n",fec_buff_num); mylog(log_info,"decode-buf=%d\n",fec_buff_num);