Skip to content

Commit

Permalink
[core] FEC: Aligned NOTDONE and SUCCESS result of hanging as acceptab…
Browse files Browse the repository at this point in the history
…le (#1790)
  • Loading branch information
ethouris authored Feb 4, 2021
1 parent 8845473 commit c89995b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions srtcore/fec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,9 @@ bool FECFilterBuiltin::receive(const CPacket& rpkt, loss_seqs_t& loss_seqs)
static string hangname [] = {"SUCCESS", "PAST", "CRAZY", "NOT-DONE"};
#endif

// Required for EHangStatus
using namespace std::rel_ops;

EHangStatus okh = HANG_NOTDONE;
if (!isfec.col) // == regular packet or FEC/ROW
{
Expand All @@ -783,7 +786,7 @@ bool FECFilterBuiltin::receive(const CPacket& rpkt, loss_seqs_t& loss_seqs)
<< " RESULT=" << hangname[okh] << " IRRECOVERABLE: " << Printable(irrecover_row));
}

if (okh != HANG_SUCCESS)
if (okh > HANG_SUCCESS)
{
// Just informative.
LOGC(pflog.Warn, log << "FEC/H: rebuilding/hanging FAILED.");
Expand All @@ -806,7 +809,7 @@ bool FECFilterBuiltin::receive(const CPacket& rpkt, loss_seqs_t& loss_seqs)
<< " IRRECOVERABLE: " << Printable(irrecover_col));
}

if (okv != HANG_SUCCESS)
if (okv > HANG_SUCCESS)
{
// Just informative.
LOGC(pflog.Warn, log << "FEC/V: rebuilding/hanging FAILED.");
Expand Down
9 changes: 7 additions & 2 deletions srtcore/fec.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,17 @@ class FECFilterBuiltin: public SrtPacketFilterBase

enum EHangStatus
{
HANG_NOTDONE,
HANG_SUCCESS,
HANG_PAST,
HANG_CRAZY,
HANG_NOTDONE
HANG_CRAZY
};

friend bool operator <(FECFilterBuiltin::EHangStatus a, FECFilterBuiltin::EHangStatus b)
{
return int(a) < int(b);
}

EHangStatus HangHorizontal(const CPacket& pkt, bool fec_ctl, loss_seqs_t& irrecover);
EHangStatus HangVertical(const CPacket& pkt, signed char fec_colx, loss_seqs_t& irrecover);
void ClipControlPacket(Group& g, const CPacket& pkt);
Expand Down

0 comments on commit c89995b

Please sign in to comment.