From 683ece76db5d952a46631f3b953872f9a9c749c6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 4 Apr 2022 09:16:27 -0500 Subject: [PATCH 1/2] MP3Decoder: Accurately inform when no more data Some audio implementations, notably samd, really don't like it when you return 0 samples of data. This was the case when reaching the end of an MP3 file. Now, we read forward in an MP3 file to the next sync word during "get_buffer", so that we can accurately return GET_BUFFER_DONE when the NEXT call WOULD HAVE resulted in 0 samples. Tested with @gamblor21's "laugh.mp3" file on a Trellis M4 Express. --- shared-module/audiomp3/MP3Decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/audiomp3/MP3Decoder.c b/shared-module/audiomp3/MP3Decoder.c index 2d45313814..d0aecc18bd 100644 --- a/shared-module/audiomp3/MP3Decoder.c +++ b/shared-module/audiomp3/MP3Decoder.c @@ -364,7 +364,7 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t * } self->samples_decoded += *buffer_length / sizeof(int16_t); - return GET_BUFFER_MORE_DATA; + return mp3file_find_sync_word(self) ? GET_BUFFER_MORE_DATA : GET_BUFFER_DONE; } void audiomp3_mp3file_get_buffer_structure(audiomp3_mp3file_obj_t *self, bool single_channel_output, From 0da10d802ced72486cd0b5098564133c955499cf Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 4 Apr 2022 22:36:58 -0400 Subject: [PATCH 2/2] advance espressif CI cache id --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b95926871..6df3935555 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -400,7 +400,7 @@ jobs: id: idf-cache with: path: ${{ github.workspace }}/.idf_tools - key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20210923 + key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20220404 - name: Clone IDF submodules run: | (cd $IDF_PATH && git submodule update --init)