Commit e01bbad7 authored by Max Kellermann's avatar Max Kellermann

lib/xiph/OggVisitor: update the OggStreamState offset

parent 7e3eaa59
...@@ -72,7 +72,7 @@ inline void ...@@ -72,7 +72,7 @@ inline void
OggDecoder::SeekByte(offset_type offset) OggDecoder::SeekByte(offset_type offset)
{ {
input_stream.LockSeek(offset); input_stream.LockSeek(offset);
PostSeek(); PostSeek(offset);
} }
void void
......
...@@ -94,9 +94,10 @@ OggVisitor::Visit() ...@@ -94,9 +94,10 @@ OggVisitor::Visit()
} }
void void
OggVisitor::PostSeek() OggVisitor::PostSeek(uint64_t offset)
{ {
sync.Reset(); sync.Reset();
sync.SetOffset(offset);
/* reset the stream to clear any previous partial packet /* reset the stream to clear any previous partial packet
data */ data */
......
...@@ -53,12 +53,18 @@ public: ...@@ -53,12 +53,18 @@ public:
return stream.GetSerialNo(); return stream.GetSerialNo();
} }
uint64_t GetStartOffset() const noexcept {
return sync.GetStartOffset();
}
void Visit(); void Visit();
/** /**
* Call this method after seeking the #Reader. * Call this method after seeking the #Reader.
*
* @param offset the current #Reader offset
*/ */
void PostSeek(); void PostSeek(uint64_t offset);
private: private:
void EndStream(); void EndStream();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment