Skip to content

Commit

Permalink
[core] Improving sending queue sleepto accuracy.
Browse files Browse the repository at this point in the history
Default sleep of 10 ms replaced with actual desired sleeping time.
  • Loading branch information
maxsharabayko committed Aug 14, 2019
1 parent 7ec45dd commit 2cdcfc2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion srtcore/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ void CTimer::sleepto(uint64_t nexttime)
__nop ();
#endif
#else
const uint64_t wait_us = 10000; // 10 ms
const uint64_t wait_us = (m_ullSchedTime - t) / CTimer::getCPUFrequency();
if (wait_us <= 0)
break;

timeval now;
gettimeofday(&now, 0);
Expand Down

0 comments on commit 2cdcfc2

Please sign in to comment.