type 1 bug fixed

This commit is contained in:
wangyu- 2017-10-10 05:52:59 -05:00
parent 3b7619e081
commit 5b36ef7f23

View File

@ -11,6 +11,8 @@
#include "lib/rs.h"
#include "fd_manager.h"
const int encode_fast_send=1;
const int decode_fast_send=1;
blob_encode_t::blob_encode_t()
{
clear();
@ -473,7 +475,6 @@ int fec_decode_manager_t::input(char *s,int len)
int missed_packet[max_fec_packet_num+5];
int missed_packet_counter=0;
for(int i=0;i<data_num;i++)
{
if(output_s_arr_buf[i]==0 ||i==inner_index) //only missed packet +current packet
@ -481,6 +482,7 @@ int fec_decode_manager_t::input(char *s,int len)
missed_packet[missed_packet_counter++]=i;
}
}
rs_decode2(data_num,data_num+redundant_num,output_s_arr_buf,max_len);
for(int i=0;i<data_num;i++)
{
@ -501,14 +503,17 @@ int fec_decode_manager_t::input(char *s,int len)
if(fec_ok)
{
//output_n=data_num;
output_n=data_num;
if(decode_fast_send)
{
output_n=missed_packet_counter;
for(int i=0;i<missed_packet_counter;i++)
{
output_s_arr_buf[i]=output_s_arr_buf[missed_packet[i]];
output_len_arr_buf[i]=output_len_arr_buf[missed_packet[i]];
}
}
output_s_arr=output_s_arr_buf;
@ -526,6 +531,8 @@ int fec_decode_manager_t::input(char *s,int len)
else
{
if(decode_fast_send)
{
if(type==1&&inner_index<data_num)
{
assert(ready_for_output==0);
@ -544,6 +551,7 @@ int fec_decode_manager_t::input(char *s,int len)
ready_for_output=1;
}
}
}
index++;
if(index==int(anti_replay_buff_size)) index=0;