[theora-dev] Theora packets with granulepos of -1

Conrad Parker conrad at metadecks.org
Sat May 9 02:18:29 PDT 2009

2009/2/24 salsaman <salsaman at gmail.com>:
> On Tue, Feb 24, 2009 at 10:10 AM, ogg.k.ogg.k at googlemail.com
> <ogg.k.ogg.k at googlemail.com> wrote:
>>> Well, your procedure for seeking is dangerously wrong for a start. If
>>> you follow your advice, one would begin decoding from the _last_ page
>>> of the previous keyframe - as opposed to the first page (or as near as
>>> posible) of the keyframe.
>> Could you be more specific about what is wrong ? This page seems to
>> be a high level overview of seeking, I believe Conrad had posted a
>> finer grained list of steps to ogg-dev a few months ago, and I thought
>> this had been copied to the wiki, but maybe not (or somewhere else).
> You need to seek to a granulepos *before* the keyframe, and start
> counting from there. Otherwise you will not decode the keyframe
> properly.

ok, reviewing that now I'd collapsed that into the definition of seeking:

"Define seek to mean: for each logical bitstream, locate the
bytewise-latest page in the bitstream with a time < the target time,
then choose the bytewise-earliest among these pages. Thus if two pages
have the same time, seeking will locate the bytewise-earlier page."

So that when applied to the last step of finding the keyframe (prev_granule):

"3. seek to the time represented by the prev_granule"

it finds the bytewise-latest page with time < the prev_granule. The
algorithm you suggest will search for a page <= (keyframe-1): I think
this is equivalent to just searching for < keyframe.

So I think the current wiki text is equivalent to what you're saying,
but your wording is clearer. Could you please update the wiki page on
Seeking with a clearer explanation? :-)

Also you pointed out the need to check for a 0 or 1 start, which
should also be documented there.

And yes, my next step is to update liboggz accordingly :-)



More information about the theora-dev mailing list