cruxic / jvorbiscomment

A java library for reading and writing Ogg Vorbis comments (tags)
MIT License
3 stars 1 forks source link

java.io.EOFException: Incomplete Vorbis stream! Missing 3 of the 3 required header packets #3

Open RobustCoder opened 4 years ago

RobustCoder commented 4 years ago

cruxic: I just downloaded your latest version 1.0.3 of jvorbiscomment.

While processing my FLAC music file directory tree, it crashed on the very first file encountered.

In particular, a call to VorbisIO.readComments failed with the following stack trace:

Caused by: java.io.EOFException: Incomplete Vorbis stream!  Missing 3 of the 3 required header packets.
    at adamb.vorbis.VorbisPacketStream.next(Unknown Source)
    at adamb.vorbis.VorbisIO.readComments(Unknown Source)
    at adamb.vorbis.VorbisIO.readComments(Unknown Source)
    at adamb.vorbis.VorbisIO.readComments(Unknown Source)
    at FlacUtil.extractVorbisComments(FlacUtil.java:558)
    ... 14 more

I have no idea why this error occurred. All of the .flac files in this directory tree can be opened with mp3tag or foobar2000 with no issues.

About 10 years ago, I first downloaded and used your code back when it was hosted on google. I was using these jar files of yours:

flac-comments-0.5.0.jar
jvorbiscomment-1.1.0.jar

My old code was almost the same as my code for your latest version of jvorbiscomment, except that the old call to FlacIO.readVorbisComments had to be changed to VorbisIO.readComments.

I was motivated to update to your latest code, by the way, when I tried using your old code to process this same directory tree and it failed with a different exception.

With your old code, it successfully read many files in that tree before eventually failing on one which generated this stack trace:

Caused by: java.io.EOFException: EOF while skipping over 192084 metadata bytes
    at adamb.flac.FlacIO.readVorbisComments(Unknown Source)
    at FlacUtil.extractVorbisComments(FlacUtil.java:558)
    ... 14 more

Once again, the file that your old code failed on can be opened with mp3tag or foobar2000 with no issues.

I am attaching the .flac file that your new code fails on which generates that first stack trace above. UPDATE: I found that I could not directly upload the .flac file to github, but had to wrap it inside a .zip file first, so that is what you will get. zipWrapperAroundFlacFile.zip

cruxic commented 4 years ago

You said that you previously used:

I think these were experimental versions having FLAC support. I never received feedback at the time so I don't think I ever committed it. That was more than ten years ago! The current release, 1.0.3, does not support FLAC, which is why you are having problems with it.

Where did you get flac-comments-0.5.0.jar? Do you have the source code to go with it?

RobustCoder commented 4 years ago

Cruxic: I have no exact recollection of how I got those 2 jars. My old code had a comment about the jvorbiscomment project being on Google, so I am sure that you must have put those jars up on that former hosting website way back then.

Is it hard to add support for FLAC files?

I love your software's simple API. It is easier to work with than the project I have now been forced to turn to, which is jaudiotagger.