Add upper limit to the index of the histograms bins (fix crash).
The crash occured when a lot of packets (>31) where missing FEC. Then the length of the sequence of lost packets was more than the size (mBins) of the histograms in printLostPacketsHisto (in fec-stream-stats.cc). The fix is simply:
lost_sequence_size = (lost_sequence_size < mBins - 1) ? lost_sequence_size : mBins - 1; ++mLocalHistoGapSize[lost_sequence_size]; ++mGlobalHistoGapSize[lost_sequence_size];
Other modifications (tools for internal study of FEC): Correct the counter of definitely lost packets. When a packet n is read from jitter buffer, if the last one was m and n -m > 1, then the list of missing packets is updated. All missing packets older than m that where asked in FEC but has not been repaired are supposed to have been found in the jitter buffer. It could happen if the packets do not arrive in chronological order. If the gap between m and n is bigger than 100 there could be a reset in the sequence numbers. In that case the new sequence numbers are not considered, as it would lead to count a large number of lost packets that may not exist.