Re: Getting samples in a packet without decoding
Brendan Bolles <[email protected]> Tue, 5 Aug 2014 20:17:15 -0700
| Newsgroups | gmane.comp.multimedia.ogg.vorbis.devel |
|---|---|
| Message-ID | <[email protected]> |
On Aug 5, 2014, at 7:02 PM, [email protected] 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