[theora-dev] further debugging of my ogg/theora decoder

Ralph Giles giles at xiph.org
Tue Nov 18 19:44:22 PST 2008

On Tue, Nov 18, 2008 at 6:48 PM, salsaman <salsaman at gmail.com> wrote:

> OK, everything is working now ! I decided not to bother getting the version
> number - I simply do a test when the file is opened to see what the first
> granulepos is after a frame is returned. From this I can calculate the first
> keyframe (either 0 or 1).

That works too. The version is the first three bytes after the
'\x80theora' id string in the first packet.

00:00:00.000: serialno 0540560690, granulepos 0|0, packetno 0 *** bos: 42 bytes
    0000: 8074 6865 6f72 6103 0201 001e 0017 0001  .theora.........

That's 0x80, 'theora' 0x03, 0x02, 0x01 in the first 16 bytes, for
version number 3.2.1.

You can also get it from version_major, version_minor and
version_subminor fields of the theora_info or th_info structs.


More information about the theora-dev mailing list