From 98858218d5ada996dd302e31afc09a085eb86603 Mon Sep 17 00:00:00 2001 From: xenakios Date: Fri, 17 Nov 2017 17:17:31 +0200 Subject: [PATCH] When setting stretchsource playrange, don't clear the ring buffer and seek only if the current seek position is not within the new play range --- Source/PS_Source/StretchSource.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/PS_Source/StretchSource.cpp b/Source/PS_Source/StretchSource.cpp index ffbeda6..fb898c2 100644 --- a/Source/PS_Source/StretchSource.cpp +++ b/Source/PS_Source/StretchSource.cpp @@ -480,11 +480,11 @@ void StretchAudioSource::setPlayRange(Range playrange, bool isloop) m_playrange = { 0.0,1.0 }; else m_playrange = playrange; - m_stretchoutringbuf.clear(); m_stream_end_reached = false; m_inputfile->setActiveRange(m_playrange); m_inputfile->setLoopEnabled(isloop); - m_inputfile->seek(m_playrange.getStart()); + if (m_playrange.contains(m_seekpos)==false) + m_inputfile->seek(m_playrange.getStart()); m_seekpos = m_playrange.getStart(); ++m_param_change_count; }