[Vorbis-dev] Getting samples in a packet without decoding

Brendan Bolles brendan at fnordware.com
Tue Aug 5 20:17:15 PDT 2014


On Aug 5, 2014, at 7:02 PM, xiphmont at xiph.org wrote:

> First packet never returns samples; it can't.  Samples are always the
> result of overlapping two packets.
> 
> Vorbis packets are always one of two blocksizes, so streams that have
> a fractional number of packets (or were trimmed at the beginning/end)
> must be signalled some way.  I don't know how Matroska does it.  Ogg
> signals this with a granule posiiton value less than the expected
> sample count.  If that happens on the first page, samples are trimmed
> off the beginning of the stream.  If it happens on the last page,
> samples are trimmed off the end.  If it happens in the middle, it's a
> soft error.


Does that apply to the first packet of the entire file, or does that also apply when you've done a seek, and then started over again with a new vorbis_synthesis_init() and vorbis_block_init()?

Seems like the first packet I pass to vorbis_synthesis_pcmout() after that always returns 0 samples.


Brendan



More information about the Vorbis-dev mailing list