From 9a9e030d906405108e9808716b634d67bcdf31a8 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Thu, 19 May 2022 17:17:21 -0700 Subject: [PATCH] Add more tests to host testing in CI (#534) Add more tests to host testing in CI Fix FLAC potential 1st sample output oddity --- .github/workflows/pr-or-master-push.yml | 4 ++++ src/AudioGeneratorFLAC.cpp | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-or-master-push.yml b/.github/workflows/pr-or-master-push.yml index 3bbdbb9..c4dbbae 100644 --- a/.github/workflows/pr-or-master-push.yml +++ b/.github/workflows/pr-or-master-push.yml @@ -106,7 +106,11 @@ jobs: valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all --error-exitcode=999 ./mp3 valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all --error-exitcode=999 ./aac valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all --error-exitcode=999 ./wav + valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all --error-exitcode=999 ./flac + valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all --error-exitcode=999 ./mod + valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all --error-exitcode=999 ./wav valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all --error-exitcode=999 ./midi + valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all --error-exitcode=999 ./opus lint: runs-on: ubuntu-latest diff --git a/src/AudioGeneratorFLAC.cpp b/src/AudioGeneratorFLAC.cpp index bd6e801..f315133 100644 --- a/src/AudioGeneratorFLAC.cpp +++ b/src/AudioGeneratorFLAC.cpp @@ -62,6 +62,9 @@ bool AudioGeneratorFLAC::begin(AudioFileSource *source, AudioOutput *output) output->begin(); running = true; + lastSample[0] = 0; + lastSample[1] = 0; + channels = 0; return true; } @@ -71,7 +74,7 @@ bool AudioGeneratorFLAC::loop() if (!running) goto done; - if (!output->ConsumeSample(lastSample)) goto done; // Try and send last buffered sample + if (channels && !output->ConsumeSample(lastSample)) goto done; // Try and send last buffered sample do { if (buffPtr == buffLen) {