Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Aligned NOTDONE and SUCCESS result of hanging as acceptable #1790

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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