From 13db993f136086e59be18f373684528181a010d0 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Mon, 19 Dec 2016 15:00:44 +0100 Subject: [PATCH] MP3 playing improved: block read --- .../decompiler/flash/types/sound/MP3Decoder.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/sound/MP3Decoder.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/sound/MP3Decoder.java index 0bcdbe688..8eb35539e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/sound/MP3Decoder.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/sound/MP3Decoder.java @@ -88,6 +88,18 @@ public class MP3Decoder extends SoundDecoder { return -1; } + + @Override + public int read(byte[] b, int off, int len) throws IOException { + len = Math.min(len, remaining); + if (len > 0) { + System.arraycopy(buf, pos, b, off, len); + remaining -= len; + pos += len; + } + + return len; + } } public MP3Decoder(SoundFormat soundFormat) {