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 19, 2019
1 parent 7ec45dd commit 5faf775
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion srtcore/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ 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();
// The while loop ensures that (t < m_ullSchedTime).
// Division by frequency üøïðå loos prevision.
if (wait_us == 0)
break;

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

0 comments on commit 5faf775

Please sign in to comment.