From 6e8538c7c979bb133ebac1fdb8ac4672365bcc28 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sun, 23 Mar 2025 16:18:07 -0700 Subject: [PATCH] minimp3: Fix seeking behavior Seeking should clear the sample buffer if it contains anything, and non- seekable files should return an error on an attempt to seek. Signed-off-by: Christopher Snowhill --- Plugins/minimp3/MP3Decoder.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Plugins/minimp3/MP3Decoder.m b/Plugins/minimp3/MP3Decoder.m index d7134fc66..d2f245833 100644 --- a/Plugins/minimp3/MP3Decoder.m +++ b/Plugins/minimp3/MP3Decoder.m @@ -290,6 +290,9 @@ static int mp3_seek_callback(uint64_t position, void *user_data) { if(error < 0) { return -1; } + samples_filled = 0; + } else { + return -1; } seconds = (double)frame / (double)_decoder_info.hz;