[theora-dev] ogg packets get lost

Yorn yorn at gmx.net
Fri Jan 4 02:29:25 PST 2008


I am actually working on a c++ wrapper for ogg/theora. It will be a small 
library to easily create command line tools to cut/cat video-files and to 
extract and join the video and audio stream etc.

However, I started the project and found some very strange behaviors:
I stored some ogg_packet objects (which are created on the heap) in a list.
When I make several calls to ogg_stream_pagein() and ogg_stream_packetout(), 
the packets are accidentally overwritten by some nonsense.

I am not sure what really happens, but I guess the libogg writers wanted to 
reduce the memory copy to a minimum, so that there are pointers (packet), 
which will be reused or whatever.

My question is: how do you (other developers) solve this problem? Creating a 
copy of the ogg_packet (including the areas, where the packet pointer directs 
to) would be a way. However I think I have to do the same for the ogg_pages!? 
Or are there any other, easier tricks to solve this problem?

Thanks in advance

PS: I added the demo file, I created to figure out the problem

-------------- next part --------------
A non-text attachment was scrubbed...
Name: testStream.cpp
Type: text/x-c++src
Size: 5239 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/theora-dev/attachments/20080104/86157cc5/testStream.cpp

More information about the theora-dev mailing list