summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXANTRONIX Development2022-03-10 15:29:16 -0500
committerXANTRONIX Development2022-03-10 15:29:16 -0500
commit906c5afd82dd289ba3af285acca5b9a8b1cf8e1c (patch)
treef9ee0f66c40030ac81dd6b6c9b25f5876b1d6914 /src
parent316ab6ba76addc02a229c1a852182be55df29307 (diff)
downloadxas-906c5afd82dd289ba3af285acca5b9a8b1cf8e1c.tar.gz
xas-906c5afd82dd289ba3af285acca5b9a8b1cf8e1c.tar.bz2
xas-906c5afd82dd289ba3af285acca5b9a8b1cf8e1c.zip
Ensure ev->next is NULL by default
Diffstat (limited to 'src')
-rw-r--r--src/seq.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/seq.c b/src/seq.c
index 054b61c..c763db4 100644
--- a/src/seq.c
+++ b/src/seq.c
@@ -48,6 +48,8 @@ static int event_add(xas_seq *seq, xas_seq_event *ev) {
seq->last = ev;
}
+ ev->next = NULL;
+
return 0;
}
@@ -612,6 +614,10 @@ int xas_seq_play(xas_seq *seq, xas_audio_stream *sink) {
goto error_event_trigger;
}
+ if (ev->next == NULL) {
+ goto done;
+ }
+
ev = ev->next;
}
@@ -630,6 +636,7 @@ int xas_seq_play(xas_seq *seq, xas_audio_stream *sink) {
frame++;
}
+done:
xas_audio_stream_destroy(source);
return frame * buffer_size;