diff options
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r-- | src/drumgizmo.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc index 135975d..5e14179 100644 --- a/src/drumgizmo.cc +++ b/src/drumgizmo.cc @@ -351,11 +351,14 @@ void DrumGizmo::getSamples(int ch, int pos, sample_t *s, size_t sz) EventSample *evt = (EventSample *)event; AudioFile *af = evt->file; - if(!af->isLoaded() || s == NULL) { + if(!af->isLoaded() || !af->isValid() || s == NULL) { removeevent = true; break; } + { + MutexAutolock l(af->mutex); + size_t n = 0; if(evt->offset > (size_t)pos) n = evt->offset - pos; size_t end = sz; @@ -389,6 +392,8 @@ void DrumGizmo::getSamples(int ch, int pos, sample_t *s, size_t sz) // LAZYLOAD: // loader.reset(af); } + + } } break; } |