When an mp3 was finished playing for me, it would crash with an ArrayIndexOutOfBoundsException.
to combat this I caught the exception and cast endOfStream. I don't know if this is the best way to handle it, but its working great for me now. Thanks for this codec.
Also, I tried posting on your forum post on paulscode, but it seems the web server died. Here is a diff patch for the changes I made:
Interesting, I don't have that ArrayIndexOutOfBoundsException when a mp3 finished playing.
Your patch adds only a simple catch clause, but I integrated it into the repository and released a new download package (r2, included the optimizations from Lioncash).
Thank you for testing and reporting.
PS: Please add a patch as an attachment, makes it easier for me to apply and test it.
Last edit: fireandfuel 2012-06-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When an mp3 was finished playing for me, it would crash with an ArrayIndexOutOfBoundsException.
to combat this I caught the exception and cast endOfStream. I don't know if this is the best way to handle it, but its working great for me now. Thanks for this codec.
Also, I tried posting on your forum post on paulscode, but it seems the web server died. Here is a diff patch for the changes I made:
~~~~~~~~~~~~~~~~~~~~
Index: src/de/cuina/fireandfuel/CodecJLayerMP3.java
===================================================================
--- src/de/cuina/fireandfuel/CodecJLayerMP3.java (revision 11)
+++ src/de/cuina/fireandfuel/CodecJLayerMP3.java (working copy)
@@ -28,7 +28,6 @@
import javazoom.jl.decoder.Header;
import javazoom.jl.decoder.Obuffer;
import javazoom.mp3spi.DecodedMpegAudioInputStream;
-
import paulscode.sound.ICodec;
import paulscode.sound.SoundBuffer;
import paulscode.sound.SoundSystemConfig;
@@ -218,8 +217,7 @@
// keep track of how many bytes were read:
bytesRead += cnt;
}
/*
* errorMessage( "Exception thrown while reading from the " +
* "AudioInputStream (location #3)." ); printStackTrace( e ); return
@@ -228,6 +226,11 @@
// OGG files!
endOfStream(SET, true);
return null;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Interesting, I don't have that ArrayIndexOutOfBoundsException when a mp3 finished playing.
Your patch adds only a simple catch clause, but I integrated it into the repository and released a new download package (r2, included the optimizations from Lioncash).
Thank you for testing and reporting.
PS: Please add a patch as an attachment, makes it easier for me to apply and test it.
Last edit: fireandfuel 2012-06-22
will do. I didnt see the the attachment feature, actually until just now actually. Don't use sourceforge much.