Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: How to get all packets of ogg file (Read 12559 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to get all packets of ogg file

I want to get all the vorbis packets of ogg file and put it into a list and I don't want to decode it right now.

now I have do this:

Code: [Select]
ogg_sync_state oy;
ogg_stream_state os;
ogg_page og;
ogg_packet op;
vorbis_info vi;
vorbis_comment vc;
vorbis_dsp_state vd;
vorbis_block vb;

vorbis_synthesis_init(&vd,&vi);
vorbis_block_init(&vd,&vb);
ogg_sync_pageout(&oy,&og);
ogg_stream_pagein(&os,&og);
ogg_stream_packetout(&os,&op);

//decode packet right now.   if I don't decode it right now then will skip this step

/*
vorbis_synthesis(&vb,&op)
vorbis_synthesis_pcmout(&vd,&pcm)
vorbis_synthesis_read
*/

//continue to get packet


if I decode packet right now then I can continue to get packets. But if I don't decode it and I just want to put they into List then I cannot to get the packets. How should I do?

 

How to get all packets of ogg file

Reply #1
I've never used libogg, but maybe ogg_sync_pageseek()?