diff options
author | Max Kellermann <max@duempel.org> | 2013-01-08 01:01:40 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-08 01:08:01 +0100 |
commit | 9fb5aad1576920dc17481591e737b74b2f4ab12f (patch) | |
tree | 397843fd6ae94588420775ccb697a22fc41a5b28 /src/decoder/OggUtil.cxx | |
parent | a6301d45f4a347e068414e6075be2e5f87eef948 (diff) | |
download | mpd-9fb5aad1576920dc17481591e737b74b2f4ab12f.tar.gz mpd-9fb5aad1576920dc17481591e737b74b2f4ab12f.tar.xz mpd-9fb5aad1576920dc17481591e737b74b2f4ab12f.zip |
decoder/OggUtil: add OggExpectFirstPage() and OggExpectPageIn()
Diffstat (limited to 'src/decoder/OggUtil.cxx')
-rw-r--r-- | src/decoder/OggUtil.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/decoder/OggUtil.cxx b/src/decoder/OggUtil.cxx index 7dda282c8..b821acfc6 100644 --- a/src/decoder/OggUtil.cxx +++ b/src/decoder/OggUtil.cxx @@ -51,3 +51,28 @@ OggExpectPage(ogg_sync_state &oy, ogg_page &page, return false; } } + +bool +OggExpectFirstPage(ogg_sync_state &oy, ogg_stream_state &os, + decoder *decoder, input_stream *is) +{ + ogg_page page; + if (!OggExpectPage(oy, page, decoder, is)) + return false; + + ogg_stream_init(&os, ogg_page_serialno(&page)); + ogg_stream_pagein(&os, &page); + return true; +} + +bool +OggExpectPageIn(ogg_sync_state &oy, ogg_stream_state &os, + decoder *decoder, input_stream *is) +{ + ogg_page page; + if (!OggExpectPage(oy, page, decoder, is)) + return false; + + ogg_stream_pagein(&os, &page); + return true; +} |