From 160364ae70291e598a03aac8ab9cce1c6cefc527 Mon Sep 17 00:00:00 2001 From: Owen Williams Date: Thu, 19 Mar 2015 19:26:41 -0400 Subject: [PATCH] Fix a couple of spots where seek destination was unchecked for evenness --- src/engine/enginebuffer.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/engine/enginebuffer.cpp b/src/engine/enginebuffer.cpp index b0ff9811a50..6004748edea 100644 --- a/src/engine/enginebuffer.cpp +++ b/src/engine/enginebuffer.cpp @@ -1107,7 +1107,9 @@ void EngineBuffer::processSlip(int iBufferSize) { m_dSlipRate = m_rate_old; } else { // TODO(owen) assuming that looping will get canceled properly - slotControlSeekExact(m_dSlipPosition); + double newPlayFrame = m_dSlipPosition / kSamplesPerFrame; + double roundedSlip = round(newPlayFrame) * kSamplesPerFrame; + slotControlSeekExact(roundedSlip); m_dSlipPosition = 0; } } @@ -1154,9 +1156,12 @@ void EngineBuffer::processSeek() { switch (seekType) { case NO_SEEK: return; - case SEEK_EXACT: + case SEEK_EXACT: { + double newPlayFrame = position / kSamplesPerFrame; + position = round(newPlayFrame) * kSamplesPerFrame; setNewPlaypos(position); break; + } case SEEK_STANDARD: { bool paused = m_playButton->get() == 0.0; // If we are playing and quantize is on, match phase when seeking.