Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression from merging 2.3 branch into 2.4 #11266

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/waveform/visualplayposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,18 @@ double VisualPlayPosition::calcPosAtNextVSync(
double playPos = data.m_enginePlayPos; // load playPos for the first sample in Buffer
if (data.m_audioBufferMicroS != 0.0) {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
Q_UNUSED(vSyncThread);
Q_UNUSED(pVSyncThread);
int refToVSync = 0;
int syncIntervalTimeMicros = 0;
#else
int refToVSync = pVSyncThread->fromTimerToNextSyncMicros(data.m_referenceTime);
int syncIntervalTimeMicros = pVSyncThread->getSyncIntervalTimeMicros();
#endif
int offset = refToVSync - data.m_callbackEntrytoDac;
// The offset is limited to the audio buffer + waveform sync interval
// This should be sufficient to compensate jitter, but does not continue
// in case of underflows.
int maxOffset = static_cast<int>(data.m_audioBufferMicroS +
pVSyncThread->getSyncIntervalTimeMicros());
int maxOffset = static_cast<int>(data.m_audioBufferMicroS + syncIntervalTimeMicros);
offset = math_clamp(offset, -maxOffset, maxOffset);
// add the offset for the position of the sample that will be transferred to the DAC
// When the next display frame is displayed
Expand Down