Re: Theora packets with granulepos of -1
Conrad Parker <[email protected]>
| Newsgroups | gmane.comp.multimedia.ogg.theora.devel |
|---|---|
| Message-ID | <[email protected]> |
2009/2/24 salsaman <[email protected]>: > On Tue, Feb 24, 2009 at 10:10 AM, [email protected] > <[email protected]> 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 :-) cheers, Conrad.