hi, in my quest to grok ogg i tried to write a small program which extracts ogg_packets, and stuffs them back into ogg pages (which are then written to a file). extracting the packets works fine, but i have problems stuffing them into a new ogg stream. pseudo code: ogg_stream_init(os, serialno) foreach p in packets: ogg_stream_packetin(os, p) // try to extract a page ogg_stream_pageout(os, og) ogg_stream_pageout() always seems to return a valid ogg page - however, it does "return" the page, but it does not "extract" the page from the stream - if i call ogg_stream_pageout() more then once, i always get the same ogg_page. replacing ogg_stream_pageout() with ogg_stream_flush() got the same results. what is the proper way of creating an ogg_page? Thank you very much, Chris
On Mon, Oct 18, 2004 at 04:52:20PM +0200, Christoph Rupp wrote:> > // try to extract a page > ogg_stream_pageout(os, og) > > ogg_stream_pageout() always seems to return a valid ogg page - however, > it does "return" the page, but it does not "extract" the page from the > stream - if i call ogg_stream_pageout() more then once, i always get the > same ogg_page.Are you checking the return code of Ogg_stream_pageout()? It will only fill out the og struct if it decided to flush a page; by default it waits until it has 4kB (except for teh first page, which it flushes after one packet.) If og isn't being updated it might look like it was retunring the same page multiple times. The return code would tell you if this happened. -r
Ralph Giles wrote:> On Mon, Oct 18, 2004 at 04:52:20PM +0200, Christoph Rupp wrote: > >> // try to extract a page >> ogg_stream_pageout(os, og) >> > Are you checking the return code of Ogg_stream_pageout()? It will only > fill out the og struct if it decided to flush a page; by default it waitsoh yes, i was checking the return code. it was just that i was checking it against a wrong value... :-/ thanks, it works now :) Chris
On Tue, Oct 19, 2004 at 04:54:50PM +0200, Christoph Rupp wrote:> > oh yes, i was checking the return code. it was just that i was checking > it against a wrong value... :-/ thanks, it works now :)Glad you got it working. :-) -r