lib/xiph/OggStreamState: new ogg_stream_state wrapper

This commit is contained in:
Max Kellermann
2016-05-09 13:26:01 +02:00
parent 1cf632e98b
commit 8af68db965
3 changed files with 81 additions and 4 deletions

View File

@@ -23,6 +23,7 @@
#include "OpusHead.hxx"
#include "OpusTags.hxx"
#include "OggFind.hxx"
#include "lib/xiph/OggStreamState.hxx"
#include "lib/xiph/OggSyncState.hxx"
#include "../DecoderAPI.hxx"
#include "decoder/Reader.hxx"
@@ -209,11 +210,13 @@ LoadEOSPacket(InputStream &is, Decoder *decoder, int serialno,
EOS packet */
DecoderReader reader(decoder, is);
OggSyncState oy(reader);
ogg_stream_state os;
ogg_stream_init(&os, serialno);
bool result = OggSeekFindEOS(oy, os, packet, is);
ogg_stream_clear(&os);
bool result;
{
OggStreamState os(serialno);
result = OggSeekFindEOS(oy, os, packet, is);
}
/* restore the previous file position */
is.LockSeek(old_offset, IgnoreError());