[theora] Indexing Ogg files for faster seeking

Gregory Maxwell gmaxwell at gmail.com
Fri Jan 22 15:21:48 PST 2010


On Fri, Jan 22, 2010 at 5:23 PM, Chris Pearce <chris at pearce.org.nz> wrote:
> To a certain degree, OggIndex does this as a safety feature, so that I
> don't hose my input files. during development. Because OggIndex is
> indexing existing Ogg files, the file has to be rewritten anyway to make
> room for the index. One day I'll get around to making OggIndex work on
> the file in place, but it would still need to rewrite it to accommodate
> the index

I wasn't really intending to speak to what oggindex is currently
doing.  But more to what is actually reasonable. It's not reasonable
that a user hitting ctrl-c or losing power during a potentially long
file manipulation job should irreparably corrupt their potentially
irreplaceable input.

For linux systems in the not too distant future the copying will
become rather cheap: There is an IOCTL for BTRFS that cow-duplicates
any range of bytes from one file descriptor to another.  The cow
duplicate only takes up some metadata space, and it doesn't even
require reading the copied data. (The range copy IOCTL is there today,
but most Linux systems are not using BTRFS yet, but they probably will
be a few years from now)

This would eliminate most of the harm of the copy without taking any
of the risk of the in-place manipulation. (it's also no harder than
the copy to code)...


More information about the theora mailing list