diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/script.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/script.c b/src/script.c index 798f793..51db3da 100644 --- a/src/script.c +++ b/src/script.c @@ -318,19 +318,18 @@ int xas_script_play(xas_script *script, xas_audio_stream *sink) { } while (ev) { - xas_script_event *next = ev->next; struct timeval tv; ssize_t readlen; timerupdate(&tv, interval, frame); - if (timercmp(&ev->timestamp, &tv, >)) { + while (ev && !timercmp(&tv, &ev->timestamp, <)) { if (event_trigger(script->scene, ev) < 0) { goto error_event_trigger; } - ev = next; + ev = ev->next; } if ((readlen = xas_audio_stream_read(source, |