aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/OggUtil.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-08 01:01:40 +0100
committerMax Kellermann <max@duempel.org>2013-01-08 01:08:01 +0100
commit9fb5aad1576920dc17481591e737b74b2f4ab12f (patch)
tree397843fd6ae94588420775ccb697a22fc41a5b28 /src/decoder/OggUtil.cxx
parenta6301d45f4a347e068414e6075be2e5f87eef948 (diff)
downloadmpd-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.cxx25
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;
+}