From cfce337d81d23bbd6d983735fa0c7c013fab3736 Mon Sep 17 00:00:00 2001 From: Lukasz Kozakiewicz Date: Tue, 24 Mar 2020 09:07:08 +0100 Subject: [PATCH] Fix mp3 file seek when seeking to previously unplayed location. --- modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp index a9056e6887..544b2daf47 100644 --- a/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp @@ -1562,7 +1562,8 @@ struct MP3Stream } frameIndex = jmin (frameIndex & ~(storedStartPosInterval - 1), - frameStreamPositions.size() * storedStartPosInterval - 1); + (frameStreamPositions.size() - 1) * storedStartPosInterval); + stream.setPosition (frameStreamPositions.getUnchecked (frameIndex / storedStartPosInterval)); currentFrameIndex = frameIndex; reset();