Commit f273cbeb authored by Monty's avatar Monty
Browse files

... beginning of the chaining example code.

Monty

svn path=/trunk/vorbis/; revision=155
parent f974b8cc
/********************************************************************
* *
* THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
* THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
* PLEASE READ THESE TERMS DISTRIBUTING. *
* *
* THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
* by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
* http://www.xiph.org/ *
* *
********************************************************************
function: simple example of opening/seeking chained bitstreams
author: Monty <xiphmont@mit.edu>
modifications by: Monty
last modification date: Oct 29 1999
********************************************************************/
#include <stdio.h>
#include <math.h>
#include "codec.h"
/* A 'chained bitstream' is a Vorbis bitstream that contains more than
one logical bitstream arranged end to end (the only form of Ogg
multiplexing allowed in a Vorbis bitstream; grouping [parallel
multiplexing] is not allowed in Vorbis) */
/* A Vorbis file can be played beginning to end (streamed) without
worrying ahead of time about chaining. If we have the whole file,
however, and want random access (seeking/scrubbing) or desire to
know the total length/time of a file, we need to account for the
possibility of chaining. */
/* We can handle things a number of ways; we can determine the entire
bitstream structure right off the bat, or piece it together later.
This example determines and caches structure for the entire
bitstream, but builds a virtual decoder on the fly when moving from
one link of the chain to another */
/* There are also different ways to implement seeking. Enough
information exists in an Ogg bitstream to seek to
sample-granularity positions in the output. Or, one can seek by
picking some portion of the stream roughtly in the area we only
want course navigation through the stream. This example implements
the latter. */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment