Skip to content

Commit

Permalink
[core] Default init duration.
Browse files Browse the repository at this point in the history
The default constructor does not set the value to 0.
  • Loading branch information
maxsharabayko committed Jul 27, 2020
1 parent 19e5a22 commit 589663f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions srtcore/core.cpp
Expand Up @@ -3657,7 +3657,7 @@ void CUDT::synchronizeWithGroup(CUDTGroup* gp)

steady_clock::time_point rcv_buffer_time_base;
bool rcv_buffer_wrap_period = false;
steady_clock::duration rcv_buffer_udrift;
steady_clock::duration rcv_buffer_udrift(0);
if (m_bTsbPd && gp->getBufferTimeBase(this, (rcv_buffer_time_base), (rcv_buffer_wrap_period), (rcv_buffer_udrift)))
{
// We have at least one socket in the group, each socket should have
Expand Down Expand Up @@ -8571,7 +8571,7 @@ void CUDT::processCtrl(const CPacket &ctrlpkt)
// inaccurate. Additionally it won't lock if TSBPD mode is off, and
// won't update anything. Note that if you set TSBPD mode and use
// srt_recvfile (which doesn't make any sense), you'll have a deadlock.
steady_clock::duration udrift;
steady_clock::duration udrift(0);
steady_clock::time_point newtimebase;
const bool drift_updated = m_pRcvBuffer->addRcvTsbPdDriftSample(ctrlpkt.getMsgTimeStamp(), m_RecvLock,
(udrift), (newtimebase));
Expand Down Expand Up @@ -13431,7 +13431,7 @@ void CUDTGroup::synchronizeDrift(CUDT* cu, steady_clock::duration udrift, steady
continue;

steady_clock::time_point this_timebase;
steady_clock::duration this_udrift;
steady_clock::duration this_udrift(0);
bool wrp = gi->ps->m_pUDT->m_pRcvBuffer->getInternalTimeBase((this_timebase), (this_udrift));

udrift = std::min(udrift, this_udrift);
Expand Down Expand Up @@ -14216,7 +14216,7 @@ void CUDTGroup::sendBackup_CheckParallelLinks(const size_t nunstable, vector<gli
continue;
}
CUDT& ce = d->ps->core();
steady_clock::duration td;
steady_clock::duration td(0);
if (!is_zero(ce.m_tsTmpActiveTime)
&& count_microseconds(td = currtime - ce.m_tsTmpActiveTime) < ce.m_uOPT_StabilityTimeout)
{
Expand Down

0 comments on commit 589663f

Please sign in to comment.