nguillaumin / jflac

Forked from SourceForge
http://jflac.sourceforge.net/
Other
25 stars 10 forks source link

couldnt get stream decoding to work #1

Closed shlomiv closed 11 years ago

shlomiv commented 11 years ago

when using Flac2PcmAudioInputStream, a reading thread goes into an infinite loop while attempting to read, in RingedAudioInputStream.read(). The cause was that when entering the read method, the code looked at frame.getFrameLength(), which in some cases might return a -1 value. AudioInputStream's constructor tries to get the proper size, and if it finds an AudioSystem.NOT_SPECIFIED size, it sets the frame size to 1.

So i made a fix in RingedAudioInputStream.read(), where now getFrameLength() gets called rather then frame.getFrameLength().

nguillaumin commented 11 years ago

Thanks, for future reference you need not to open a ticket and a pull request, the pull request itself is usually enough.

Cheers!

shlomiv commented 11 years ago

You are right :) i realized it only after i already opened the issue.. thanks!