Fix loading samples unsupported by libsndfile (#6918)

This commit is contained in:
Dominic Clark
2023-10-05 18:41:00 +01:00
committed by GitHub
parent 579d132b8a
commit f691afcc41

View File

@@ -305,10 +305,6 @@ void SampleBuffer::update(bool keepSettings)
}
sf_close(sndFile);
}
else
{
fileLoadError = FileLoadError::Invalid;
}
f.close();
}
@@ -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