Skip to content

Commit

Permalink
Merge pull request #4791 from uklotzde/engine-update-indicators-debug…
Browse files Browse the repository at this point in the history
…-assert

Turn debug assertion into a check
  • Loading branch information
ronso0 authored Jun 8, 2022
2 parents c18ad24 + 8757d43 commit 4bdf561
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/engine/enginebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,9 @@ void EngineBuffer::postProcess(const int iBufferSize) {
}

void EngineBuffer::updateIndicators(double speed, int iBufferSize) {
if (m_filepos_play == kInitialSamplePosition || m_trackSampleRateOld == 0) {
if (m_filepos_play == kInitialSamplePosition ||
m_trackSampleRateOld == 0 ||
m_tempo_ratio_old == 0) {
// Skip indicator updates with invalid values to prevent undefined behavior,
// e.g. in WaveformRenderBeat::draw().
//
Expand All @@ -1251,7 +1253,6 @@ void EngineBuffer::updateIndicators(double speed, int iBufferSize) {
// called yet.
return;
}
DEBUG_ASSERT(m_tempo_ratio_old != 0);

// Increase samplesCalculated by the buffer size
m_iSamplesSinceLastIndicatorUpdate += iBufferSize;
Expand Down

0 comments on commit 4bdf561

Please sign in to comment.