Cap time in each slice to avoid pathological cases.
E.g. when debugging. Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
f2d06cb18d
commit
177f345861
1 changed files with 4 additions and 1 deletions
|
@ -35,6 +35,8 @@
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QAudioOutput>
|
#include <QAudioOutput>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -255,7 +257,8 @@ void QApple::on_timer()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const qint64 toRun = target - current;
|
const qint64 maximumToRum = 10 * myOptions.msGap; // just to avoid crazy times (e.g. debugging)
|
||||||
|
const qint64 toRun = std::min(target - current, maximumToRum);
|
||||||
const double fUsecPerSec = 1.e6;
|
const double fUsecPerSec = 1.e6;
|
||||||
const qint64 nExecutionPeriodUsec = 1000 * toRun;
|
const qint64 nExecutionPeriodUsec = 1000 * toRun;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue