Unable to save ogg files created with Grip/Oggenc because have ID3v1 tag at the end

Issue #117 resolved
IJabz repo owner created an issue

Its okay if just make a minor change, but after making major chnage such as after Jaikoz:Autocorrect fails to save, due to using a different routine, stack trace as follows:

org.jaudiotagger.audio.exceptions.CannotReadException: OggS Header could not be found, not an ogg stream TAGH
    at org.jaudiotagger.audio.ogg.util.OggPageHeader.read(OggPageHeader.java:123)
    at org.jaudiotagger.audio.ogg.OggVorbisTagWriter.writeRemainingPages(OggVorbisTagWriter.java:458)
    at org.jaudiotagger.audio.ogg.OggVorbisTagWriter.replacePagesAndRenumberPageSeqs(OggVorbisTagWriter.java:431)
    at org.jaudiotagger.audio.ogg.OggVorbisTagWriter.write(OggVorbisTagWriter.java:139)
    at org.jaudiotagger.audio.ogg.OggFileWriter.writeTag(OggFileWriter.java:45)
    at org.jaudiotagger.audio.generic.AudioFileWriter.write(AudioFileWriter.java:432)
    at org.jaudiotagger.audio.AudioFileIO.writeFile(AudioFileIO.java:483)
    at org.jaudiotagger.audio.AudioFileIO.write(AudioFileIO.java:212)
    at org.jaudiotagger.audio.AudioFile.commit(AudioFile.java:124)

Comments (6)

  1. IJabz reporter

    So the problem is Grip can write a ID3v1 tag to the end of an Ogg file, not sure if this is legal but it happens. This is not a problem for us when we can modify the vorbis comment in the existing page, but if it requires more than one page (such as in adding artwork) we then go have to read each page and rewrite with new pageSequenceNo - and this code does not expect to find anything but a series of Ogg Pages

  2. IJabz reporter

    Fixed, now if problem reading OggPage header it rereads to see if the next bytes match a ID3v1 header (TAG) and if so the rest of the file is discarded adnd successfully written without the illegal ID3v1 tag. Note if any other info is found instead of page header we report error and dont save. Note 2:if a minor modification is amde to file and pages dont need renumbering then the TAG will not be removed.

  3. Log in to comment