ogg_stream → ogg_logical_stream

This commit is contained in:
Frédéric Mangano-Tarumi 2018-12-08 10:59:07 -05:00
parent 4e3ee61ca3
commit f080f9da70
2 changed files with 7 additions and 8 deletions

View File

@ -37,7 +37,7 @@ ot::status ot::ogg_reader::read_header_packet(const std::function<status(ogg_pac
{
if (ogg_page_continued(&page))
return {ot::st::error, "Unexpected continued header page."};
ogg_stream stream(ogg_page_serialno(&page));
ogg_logical_stream stream(ogg_page_serialno(&page));
stream.pageno = ogg_page_pageno(&page);
if (ogg_stream_pagein(&stream, &page) != 0)
return {st::libogg_error, "ogg_stream_pagein failed."};
@ -75,7 +75,7 @@ ot::status ot::ogg_writer::write_page(const ogg_page& page)
ot::status ot::ogg_writer::write_header_packet(int serialno, int pageno, ogg_packet& packet)
{
ogg_stream stream(serialno);
ogg_logical_stream stream(serialno);
stream.b_o_s = (pageno != 0);
stream.pageno = pageno;
if (ogg_stream_packetin(&stream, &packet) != 0)

View File

@ -136,22 +136,21 @@ private:
*/
/** RAII-aware wrapper around libogg's ogg_stream_state. */
struct ogg_stream : ogg_stream_state {
ogg_stream(int serialno) {
struct ogg_logical_stream : ogg_stream_state {
ogg_logical_stream(int serialno) {
if (ogg_stream_init(this, serialno) != 0)
throw std::bad_alloc();
}
~ogg_stream() {
~ogg_logical_stream() {
ogg_stream_clear(this);
}
};
/**
* Ogg reader, combining a FILE input, an ogg_sync_state reading the pages, and an ogg_stream_state
* extracting the packets from the page.
* Ogg reader, combining a FILE input, an ogg_sync_state reading the pages.
*
* Call #read_page repeatedly until #status::end_of_stream to consume the stream, and use #page to
* check its content. To extract its packets, call #read_packet until #status::end_of_packet.
* check its content.
*/
struct ogg_reader {
/**