[theora-dev] My issues with ogg and directshow...
conrad at metadecks.org
Mon May 10 20:17:27 PDT 2004
On Tue, May 11, 2004 at 01:02:20PM +1000, Michael Smith wrote:
> On Tuesday 11 May 2004 13:10, illiminable wrote:
> > This is from libfishsound, which is the wrapper i'm using to libvorbis...
> > /* Make a fake ogg_packet structure to pass the data to libvorbis */
> > op.packet = buf;
> > op.bytes = bytes;
> > op.b_o_s = (fsv->packetno == 0) ? 1 : 0;
> > op.e_o_s = 0;
> > op.granulepos = 7;
> > op.packetno = fsv->packetno;
> > I've been using it just fine, and i'm sure conrad has been for a lot
> > longer, i'm sure he can explain why it works !... it clearly doesn't make
> > that much difference... if any at all.
> > A quick search in libvorbis, i can see it being stored a few places... but
> > not actually used for anything !
> It's used (and is crucial for) proper handling of short packets ('short' in
> the sense used in the recent mux meeting).
> If libfishsound is doing this, it's going to get decode wrong at start and end
> of stream. It's even-more-obviously going to get it wrong at end of stream
> since op.e_o_s never gets set in the code you gave above.
er, no -- afaik libvorbis ignores the granulepos in the packet passed to
vorbis_synthesis() -- vorbis_synthesis basically uses an ogg_packet just
to get the data and length fields. The above pattern (creating a fake
ogg packet to pass to vorbis_synthesis) is commonplace in implementations
which separate demux and decode, not just libfishsound but also eg. xine,
I think mplayer, and I'm sure others.
Similarly the op->eos issue. That's just my understanding from reading
libvorbis code, let me know if I'm missing something. eg. there's probably
a decode flush that a should be triggered [by demux] upon receipt of eos.
Setting granulepos and eos correctly during encode is a different issue,
and obviously needs to be done correctly so holes can be flagged etc.
--- >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 'theora-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 Theora-dev