[Vorbis-dev] Splitting Ogg Vorbis file

Michael Gold mgold at ncf.ca
Tue Jun 30 05:26:20 PDT 2009


On Mon, Jun 29, 2009 at 23:45:45 +0400, Timur Elzhov wrote:
> Hi Monty!
> 
> 2009/6/29  <xiphmont at xiph.org>:
> > Two packets are needed to produce audio, not three.  The granule
> > position lists the first sample that will be produced from the
> > subsequent two packets.
> 
> Then we're coming back to initial post, where the comment from vcut.c is quoted:
> 
> /* We need to do the following:
>    ...
>  *   - Save the final two packets in the stream to temporary buffers.
>  *     These two packets then become the first two packets in the 2nd stream
>  *     (we need two packets because of the overlap-add nature of vorbis).
>     ...
>  */
> 
> So why they copy two last packets at the start of second file, when
> one packet would be enough according to your statement?
> Thanks.

One packet is enough when the cutpoint is on a packet boundary.

Otherwise, the part of the final packet that isn't used by the first
file is used to produce audio in the second file, and the other packet
is needed as its reference.

FYI, the version of vcut you're looking at doesn't handle chained
streams properly; the latest beta version has been restructured and
doesn't contain that comment.

-- Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20090630/1e0b1cb6/attachment.pgp 


More information about the Vorbis-dev mailing list