mirror of
https://github.com/fmang/opustags.git
synced 2025-01-15 20:53:16 +01:00
ogg_stream → ogg_logical_stream
This commit is contained in:
parent
4e3ee61ca3
commit
f080f9da70
@ -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)
|
||||
|
@ -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 {
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user