Skip to content

Commit fec9a40

Browse files
gou4shi1maxsharabayko
authored andcommitted
[core] fix m_iLastSchedSeqNo
1 parent 8f22c96 commit fec9a40

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

srtcore/core.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -9938,9 +9938,9 @@ int srt::CUDT::processData(CUnit* in_unit)
99389938
{
99399939
if (gi->rcvstate < SRT_GST_RUNNING) // PENDING or IDLE, tho PENDING is unlikely
99409940
{
9941-
HLOGC(qrlog.Debug, log << "processData: IN-GROUP rcv state transition "
9942-
<< srt_log_grp_state[gi->rcvstate]
9943-
<< " -> RUNNING. NOT checking for loss");
9941+
HLOGC(qrlog.Debug,
9942+
log << "processData: IN-GROUP rcv state transition " << srt_log_grp_state[gi->rcvstate]
9943+
<< " -> RUNNING.");
99449944
gi->rcvstate = SRT_GST_RUNNING;
99459945
}
99469946
else

srtcore/group.cpp

+9-5
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ bool CUDTGroup::applyGroupSequences(SRTSOCKET target, int32_t& w_snd_isn, int32_
118118

119119
HLOGC(gmlog.Debug,
120120
log << "applyGroupSequences: @" << target << " gets seq from @" << gi->id << " rcv %" << (w_rcv_isn)
121-
<< " snd %" << (w_rcv_isn) << " as " << update_reason);
121+
<< " snd %" << (w_snd_isn) << " as " << update_reason);
122122
return false;
123123
}
124124
}
@@ -1108,7 +1108,8 @@ int CUDTGroup::sendBroadcast(const char* buf, int len, SRT_MSGCTRL& w_mc)
11081108
vector<gli_t> idleLinks;
11091109
vector<SRTSOCKET> pendingSockets; // need sock ids as it will be checked out of lock
11101110

1111-
int32_t curseq = SRT_SEQNO_NONE;
1111+
int32_t curseq = SRT_SEQNO_NONE; // The seqno of the first packet of this message.
1112+
int32_t nextseq = SRT_SEQNO_NONE; // The seqno of the first packet of next message.
11121113

11131114
int rstat = -1;
11141115

@@ -1247,6 +1248,7 @@ int CUDTGroup::sendBroadcast(const char* buf, int len, SRT_MSGCTRL& w_mc)
12471248
if (stat != -1)
12481249
{
12491250
curseq = w_mc.pktseq;
1251+
nextseq = d->ps->core().schedSeqNo();
12501252
}
12511253

12521254
const Sendstate cstate = {d->id, &*d, stat, erc};
@@ -1340,6 +1342,7 @@ int CUDTGroup::sendBroadcast(const char* buf, int len, SRT_MSGCTRL& w_mc)
13401342
// Note: this will override the sequence number
13411343
// for all next iterations in this loop.
13421344
curseq = w_mc.pktseq;
1345+
nextseq = d->ps->core().schedSeqNo();
13431346
HLOGC(gslog.Debug,
13441347
log << "@" << d->id << ":... sending SUCCESSFUL %" << curseq << " MEMBER STATUS: RUNNING");
13451348
}
@@ -1351,10 +1354,11 @@ int CUDTGroup::sendBroadcast(const char* buf, int len, SRT_MSGCTRL& w_mc)
13511354
sendstates.push_back(cstate);
13521355
}
13531356

1354-
if (curseq != SRT_SEQNO_NONE)
1357+
if (nextseq != SRT_SEQNO_NONE)
13551358
{
1356-
HLOGC(gslog.Debug, log << "grp/sendBroadcast: updating current scheduling sequence %" << curseq);
1357-
m_iLastSchedSeqNo = curseq;
1359+
HLOGC(gslog.Debug,
1360+
log << "grp/sendBroadcast: $" << id() << ": updating current scheduling sequence %" << nextseq);
1361+
m_iLastSchedSeqNo = nextseq;
13581362
}
13591363

13601364
// }

0 commit comments

Comments
 (0)