[vorbis-dev] Packet Granule position

Michael Smith msmith at xiph.org
Tue Apr 20 19:38:46 PDT 2004



On Wednesday 21 April 2004 12:04, Daniel Holth wrote:
> Conrad Parker wrote:
> | On Tue, Apr 20, 2004 at 02:19:23AM +0200, Segher Boessenkool wrote:
> |>> Calculating per-packet granulepos values is possible, but
> |>> non-trivial.
>
> In vorbis it's really not hard; if you look at the libshout2 source
> you'll see that each vorbis packet has the frames-per-packet "hiding"
> a few bytes into that data. libshout2 doesn't even use per-ogg page
> granulepos (for vorbis) at all, saving itself a lot of trouble if
> pages are skipped.
>
> - Daniel Holth
>

Perhaps I should have been more specific: calculating per-packet granulepos 
values _correctly in all cases_ is possible but complex. Libshout2 does not 
do this. Note particularly that it can get it slightly wrong at the start of 
the stream (but that's relatively rare), and will usually get it slightly 
wrong at the end of the stream. Dealing with holes in the stream also, 
obviously, makes things more complex.

Mike

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list