decoder/ogg: move code to SeekByte()
This commit is contained in:
parent
8472135859
commit
6fe4068c8e
@ -68,6 +68,13 @@ OggDecoder::LoadEndGranulePos() const
|
||||
return packet.granulepos;
|
||||
}
|
||||
|
||||
inline void
|
||||
OggDecoder::SeekByte(offset_type offset)
|
||||
{
|
||||
input_stream.LockSeek(offset);
|
||||
PostSeek();
|
||||
}
|
||||
|
||||
void
|
||||
OggDecoder::SeekGranulePos(ogg_int64_t where_granulepos)
|
||||
{
|
||||
@ -79,7 +86,6 @@ OggDecoder::SeekGranulePos(ogg_int64_t where_granulepos)
|
||||
offset_type offset(where_granulepos * input_stream.GetSize()
|
||||
/ end_granulepos);
|
||||
|
||||
input_stream.LockSeek(offset);
|
||||
PostSeek();
|
||||
SeekByte(offset);
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "lib/xiph/OggVisitor.hxx"
|
||||
#include "decoder/Reader.hxx"
|
||||
#include "input/Offset.hxx"
|
||||
|
||||
class OggDecoder : public OggVisitor {
|
||||
ogg_int64_t end_granulepos;
|
||||
@ -53,6 +54,13 @@ protected:
|
||||
return end_granulepos > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Seek the #InputStream and update the #OggVisitor.
|
||||
*
|
||||
* Throws on error.
|
||||
*/
|
||||
void SeekByte(offset_type offset);
|
||||
|
||||
void SeekGranulePos(ogg_int64_t where_granulepos);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user