[ogg-dev] More trival questions

Conrad Parker conrad at metadecks.org
Mon Apr 28 18:41:22 PDT 2008


2008/4/29 Neil Leathers <neil.leathers at rogers.com>:
>         do {
>                 if (ogg_sync_pageout(&the_ogg_sync_state, &the_ogg_page) == 1) {
>                         printf("Decode Page\n");
>                         send_to_my_decoder( the_ogg_page.body, the_ogg_page.body_len );
>
>                         ogg_stream_pagein(&the_ogg_stream_state, &the_ogg_page);
>
>                         ogg_stream_packetout(&the_ogg_stream_state, &the_ogg_packet);
>
>                         printf("Decode Packet\n");
>                         send_to_my_decoder( the_ogg_packet.packet, the_ogg_packet.bytes );
>                 }

you need to loop on the call to ogg_stream_packetout(), because a page
may contain any number (0, 1, 2, ...) of completed packets.

Conrad.


More information about the ogg-dev mailing list