[theora-dev] Theora packets with granulepos of -1
giles at xiph.org
Mon Feb 23 09:23:55 PST 2009
On Mon, Feb 23, 2009 at 7:07 AM, salsaman <salsaman at gmail.com> wrote:
> That is correct. You have to calculate the keyframe granule shift for
> each file. For some strange reason best known to the developers this
> is split over 2 bytes:
Yeah, we messed up. Sorry.
> keyframe_granule_shift = (char) ((hpacket & 0x03) << 3); // lower 3 bits
> keyframe_granule_shift |= (hpacket & 0xe0) >> 5; // top 5 bits
lower two bits of byte 40, actually, and upper 4 bits of byte 41. It's
a 5 bit field.
More information about the theora-dev