diff --git a/Source/PS_Source/Input/AInputS.h b/Source/PS_Source/Input/AInputS.h index bbbf174..ad347b0 100644 --- a/Source/PS_Source/Input/AInputS.h +++ b/Source/PS_Source/Input/AInputS.h @@ -74,7 +74,9 @@ public: std::lock_guard locker(m_mutex); m_using_memory_buffer = false; m_afreader = std::unique_ptr(reader); - m_currentsample = 0; + if (m_activerange.isEmpty()) + m_activerange = { 0.0,1.0 }; + m_currentsample = m_activerange.getStart()*info.nsamples; info.samplerate = (int)m_afreader->sampleRate; info.nchannels = m_afreader->numChannels; info.nsamples = m_afreader->lengthInSamples; @@ -83,6 +85,7 @@ public: m_readbuf.setSize(info.nchannels, m_readbuf.getNumSamples()); m_crossfadebuf.setSize(info.nchannels, m_crossfadebuf.getNumSamples()); } + updateXFadeCache(); m_readbuf.clear(); return true; }