diff --git a/Userland/Libraries/LibAudio/MP3Loader.cpp b/Userland/Libraries/LibAudio/MP3Loader.cpp index 0d22d2417a..5c029a0112 100644 --- a/Userland/Libraries/LibAudio/MP3Loader.cpp +++ b/Userland/Libraries/LibAudio/MP3Loader.cpp @@ -146,7 +146,6 @@ MaybeLoaderError MP3LoaderPlugin::build_seek_table() int sample_count = 0; size_t frame_count = 0; m_seek_table = {}; - TRY(m_seek_table.insert_seek_point({ 0, 0 })); m_bitstream->align_to_byte_boundary(); @@ -157,12 +156,13 @@ MaybeLoaderError MP3LoaderPlugin::build_seek_table() if (error_or_header.is_error() || error_or_header.value().id != 1 || error_or_header.value().layer != 3) { continue; } - frame_count++; - sample_count += MP3::frame_size; if (frame_count % 10 == 0) TRY(m_seek_table.insert_seek_point({ static_cast(sample_count), frame_pos })); + frame_count++; + sample_count += MP3::frame_size; + TRY(m_stream->seek(error_or_header.value().frame_size - 6, SeekMode::FromCurrentPosition)); // TODO: This is just here to clear the bitstream buffer.