diff options
author | XANTRONIX Development | 2022-03-01 14:11:01 -0500 |
---|---|---|
committer | XANTRONIX Development | 2022-03-01 14:11:01 -0500 |
commit | 2364a4b2307176c31c08fff36c6e5427af06aad1 (patch) | |
tree | dcf318fca48566d868995b9cdd6cddea7d2406f0 /src | |
parent | 435f0e4f87aa25bd0ca5f605a5104692bd204a35 (diff) | |
download | xas-2364a4b2307176c31c08fff36c6e5427af06aad1.tar.gz xas-2364a4b2307176c31c08fff36c6e5427af06aad1.tar.bz2 xas-2364a4b2307176c31c08fff36c6e5427af06aad1.zip |
Fix infinite loop on script runs
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, |