nguillaumin / jflac

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

Stream playing hangs, premature stop, JustFlac #10

Closed wolfgangasdf closed 7 years ago

wolfgangasdf commented 8 years ago

Hi, it would be great to have an up to date jflac on maven, thanks a lot!

For me and my flacs, the 2013 commit a0eb9b4740c05a83e20746d09817356d508aee3b breaks flac file stream playing with jdk1.8.0_101, e.g., the example SndPlayer.java hangs because getFormat().getFrameSize() is 4 while getFrameLength() is -1. The example Player.java works, because it does not use RingedAudioInputStream. Would be nice if someone confirms.

Independent of this, many (not all) of my flac's stop playing prematurely/too early. Since years, I used to make the following change in jflac.sourceforge.net:

FlacAudioFileReader.java: last code line, replace audioFileFormat.getFrameLength() by audioFileFormat.getByteLength()

This doesn't agree to the java docs, so I suspect that this is an ugly hack for a bug somewhere else. I found now out that this is resolved in the other jflac fork https://github.com/drogatkin/JustFLAC which does work without this, they state that some bugs have been fixed (in 2013-2014).

Therefore I have merged the current codec+examples of JustFLAC into your nice maven environment, so one can do a mvn install, see https://github.com/wolfgangasdf/jflac

A few of the codec-related commits of your repository are not in, but I also can't see directly why they are needed (and JustFlac contains also a seek function). I also had to disable a few unit tests because of changes made in JustFlac or in your jflac after the fork.

If you want to merge this, I could check with the JustFlac developers, cleanup a few things and make a pull request.

Best, wolfgang

nguillaumin commented 8 years ago

Hi, I'm not too aware of the specifics of the codec to be honest, I just needed to Maven-ize it for a project I had. I also wasn't aware there was another fork of jFLAC out there!

So I personally won't be investigating these issues, but I wouldn't mind a pull request if you're interested.

wolfgangasdf commented 8 years ago

I made a pull request https://github.com/nguillaumin/jflac/pull/12

nguillaumin commented 7 years ago

Cheers!