Report unstretched play range length when playing original source

This commit is contained in:
xenakios 2018-02-22 02:04:30 +02:00
parent a3b034ac44
commit c98b7c70e4

View File

@ -613,6 +613,8 @@ double StretchAudioSource::getOutputDurationSecondsForRange(Range<double> range,
{ {
if (m_inputfile == nullptr || m_inputfile->info.nsamples == 0) if (m_inputfile == nullptr || m_inputfile->info.nsamples == 0)
return 0.0; return 0.0;
if (m_preview_dry==true)
return (double)range.getLength()*m_inputfile->info.nsamples/m_inputfile->info.samplerate;
int64_t play_end_pos = (fftsize * 2)+range.getLength()*m_playrate*m_inputfile->info.nsamples; int64_t play_end_pos = (fftsize * 2)+range.getLength()*m_playrate*m_inputfile->info.nsamples;
return (double)play_end_pos / m_inputfile->info.samplerate; return (double)play_end_pos / m_inputfile->info.samplerate;
} }