[flac-dev] Ogg Flac padding

Ian Nartowicz flac at nartowicz.co.uk
Tue May 20 08:52:03 PDT 2014

A program to do something I don't think can be done?  Tricky.

How about some examples of files that show problems?

Here is a basic OggFlac track, as produced by the standard flac encoder.   It
has a vorbis comment packet, a seektable packet, and a padding packet and works
fine.  Note that each packet is on a separate Ogg page.

Here is the same track with just a vorbis comment packet.  The Ogg packet is
padded with about 1024 nulls.  It also seems to work in all the tools I've
tried.  I can play this and adjust the padding to edit the metadata in place.

Now the same thing with both the vorbis comment packet padded and a separate
padding packet.  Won't play and metaflac says it is garbage.  I say it is
entirely legal, according the the Ogg Flac mapping spec and general Ogg
specification.  The Picard tagging tool reads this file OK.

A similar thing with a padded vorbis comment packet and a seektable packet.

None of these files show the issue with padding metadata blocks not working to
allow in-place writing of edited vorbis comment metadata blocks, but that just
doesn't work.  Or rather it does work sometimes, it you're lucky with the Ogg
overhead matching on the two packets, but other times the lengths don't match
and it corrupts the file.  I've given up on this because it is impossible, but
I'm slightly surprised not to get a reply that this is a well known "feature"
of the Ogg FLAC format.


More information about the flac-dev mailing list