From 131b94540e372b25ec20cab0f8197dabac21d3bd Mon Sep 17 00:00:00 2001 From: Ben Combee Date: Sun, 2 Jan 2022 15:19:25 -0600 Subject: [PATCH] audiomp3: reset decoded_samples when file resets In testing, I saw that the decoded_samples value kept increasing when I stopped and restarted playback, as I'd missed setting it back to zero during the reset operation. --- shared-module/audiomp3/MP3Decoder.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-module/audiomp3/MP3Decoder.c b/shared-module/audiomp3/MP3Decoder.c index 4687e01e43..2d45313814 100644 --- a/shared-module/audiomp3/MP3Decoder.c +++ b/shared-module/audiomp3/MP3Decoder.c @@ -304,6 +304,7 @@ void audiomp3_mp3file_reset_buffer(audiomp3_mp3file_obj_t *self, f_lseek(&self->file->fp, 0); self->inbuf_offset = self->inbuf_length; self->eof = 0; + self->samples_decoded = 0; self->other_channel = -1; mp3file_update_inbuf_half(self); mp3file_skip_id3v2(self);