Commit bb88ddeb authored by jhammen's avatar jhammen
Browse files

handle case where there is only a single sample file

parent e6129d99
...@@ -37,6 +37,7 @@ public: ...@@ -37,6 +37,7 @@ public:
Sample *samples() { return mSamples; } Sample *samples() { return mSamples; }
uint16_t sampleCount() { return mSampleCount; } uint16_t sampleCount() { return mSampleCount; }
Sample *sample() { Sample *sample() {
if(mSampleCount == 1) { return &mSamples[0]; }
uint16_t pick = rand() % (mSampleCount - 1); uint16_t pick = rand() % (mSampleCount - 1);
if(pick == last) { if(pick == last) {
last = pick = mSampleCount - 1; last = pick = mSampleCount - 1;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment