summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-04-08 10:39:33 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-04-08 10:39:33 +0200
commita3549e2521e3b77c602ef4fabdc694c4d906bffb (patch)
tree598e77214383641ca606c6dce3f1f89acfaa2ea3 /src
parent331be8dc452bf47705556d2a7f7f5988973930ca (diff)
Fix the broken fix for re-load crash.
Diffstat (limited to 'src')
-rw-r--r--src/drumgizmo.cc6
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;
}