diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-04-08 10:39:33 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-04-08 10:39:33 +0200 |
commit | a3549e2521e3b77c602ef4fabdc694c4d906bffb (patch) | |
tree | 598e77214383641ca606c6dce3f1f89acfaa2ea3 | |
parent | 331be8dc452bf47705556d2a7f7f5988973930ca (diff) |
Fix the broken fix for re-load crash.
-rw-r--r-- | src/drumgizmo.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc index 5391cdd..ba167b4 100644 --- a/src/drumgizmo.cc +++ b/src/drumgizmo.cc @@ -235,8 +235,6 @@ bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples) // Handle engine messages, at most one in each iteration: handleEngineEvents(); - if(!samples) return true; - ie->pre(); oe->pre(nsamples); @@ -283,7 +281,7 @@ bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples) while(j != kit.channels.end()) { Channel &ch = *j; AudioFile *af = s->getAudioFile(&ch); - if(af == NULL) { + if(af == NULL || !af->isValid()) { //printf("Missing AudioFile.\n"); } else { DEBUG(drumgizmo, "Adding event %d.\n", evs[e].offset); @@ -366,7 +364,7 @@ void DrumGizmo::getSamples(int ch, int pos, sample_t *s, size_t sz) EventSample *evt = (EventSample *)event; AudioFile *af = evt->file; //af->load(); // Make sure it is loaded. - if(!af->isLoaded()) { + if(!af->isLoaded() || s == NULL) { removeevent = true; break; } |