Browse Source

Tolerate max 2 frames of deviation for frame position skips

Signed-off-by: falkTX <falktx@falktx.com>
tags/22.06
falkTX 2 years ago
parent
commit
ec2222be85
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 9 additions and 2 deletions
  1. +1
    -1
      dpf
  2. +8
    -1
      src/CardinalPlugin.cpp

+ 1
- 1
dpf

@@ -1 +1 @@
Subproject commit e36355245414223d499421a87d88d8aef0b1078b
Subproject commit f0c16920f5a62300f5197b6a339dbc5fec12a882

+ 8
- 1
src/CardinalPlugin.cpp View File

@@ -81,6 +81,13 @@ namespace window {
START_NAMESPACE_DISTRHO
template<typename T>
static inline
bool d_isDiffHigherThanLimit(const T& v1, const T& v2, const T& limit)
{
return v1 != v2 ? (v1 > v2 ? v1 - v2 : v2 - v1) > limit : false;
}
// -----------------------------------------------------------------------------------------------------------
struct Initializer
@@ -1117,7 +1124,7 @@ protected:
{
const TimePosition& timePos(getTimePosition());
const bool reset = timePos.playing && (timePos.frame == 0 || fNextExpectedFrame != timePos.frame);
const bool reset = timePos.playing && (timePos.frame == 0 || d_isDiffHigherThanLimit(fNextExpectedFrame, timePos.frame, (uint64_t)2));
context->playing = timePos.playing;
context->bbtValid = timePos.bbt.valid;


Loading…
Cancel
Save