Skip to content

Commit

Permalink
Fix loading samples unsupported by libsndfile (#6918)
Browse files Browse the repository at this point in the history
  • Loading branch information
DomClark authored Oct 5, 2023
1 parent 579d132 commit f691afc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/core/SampleBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,6 @@ void SampleBuffer::update(bool keepSettings)
}
sf_close(sndFile);
}
else
{
fileLoadError = FileLoadError::Invalid;
}
f.close();
}

Expand Down Expand Up @@ -337,6 +333,11 @@ void SampleBuffer::update(bool keepSettings)
{
m_frames = decodeSampleDS(file, buf, channels, samplerate);
}

if (m_frames == 0)
{
fileLoadError = FileLoadError::Invalid;
}
}

if (m_frames == 0 || fileLoadError != FileLoadError::None) // if still no frames, bail
Expand Down

0 comments on commit f691afc

Please sign in to comment.