diff options
-rw-r--r-- | plugins/eg-sampler.lv2/sampler.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c index 6c64df5..1efad3c 100644 --- a/plugins/eg-sampler.lv2/sampler.c +++ b/plugins/eg-sampler.lv2/sampler.c @@ -211,6 +211,10 @@ work_response(LV2_Handle instance, uint32_t size, const void* data) // Install the new sample self->sample = *(Sample* const*)data; + // Stop playing previous sample, which can be larger than new one + self->frame = 0; + self->play = false; + // Schedule work to free the old sample SampleMessage msg = {{sizeof(Sample*), self->uris.eg_freeSample}, old_sample}; self->schedule->schedule_work(self->schedule->handle, sizeof(msg), &msg); |