InputStream: "protect" attributes
This commit is contained in:
@@ -185,7 +185,7 @@ LoadEOSPacket(InputStream &is, Decoder *decoder, int serialno,
|
||||
troubl */
|
||||
return -1;
|
||||
|
||||
const auto old_offset = is.offset;
|
||||
const auto old_offset = is.GetOffset();
|
||||
if (old_offset < 0)
|
||||
return -1;
|
||||
|
||||
@@ -332,16 +332,16 @@ bool
|
||||
MPDOpusDecoder::Seek(OggSyncState &oy, double where_s)
|
||||
{
|
||||
assert(eos_granulepos > 0);
|
||||
assert(input_stream.seekable);
|
||||
assert(input_stream.size > 0);
|
||||
assert(input_stream.offset >= 0);
|
||||
assert(input_stream.IsSeekable());
|
||||
assert(input_stream.KnownSize());
|
||||
assert(input_stream.GetOffset() >= 0);
|
||||
|
||||
const ogg_int64_t where_granulepos(where_s * opus_sample_rate);
|
||||
|
||||
/* interpolate the file offset where we expect to find the
|
||||
given granule position */
|
||||
/* TODO: implement binary search */
|
||||
InputStream::offset_type offset(where_granulepos * input_stream.size
|
||||
InputStream::offset_type offset(where_granulepos * input_stream.GetSize()
|
||||
/ eos_granulepos);
|
||||
|
||||
if (!OggSeekPageAtOffset(oy, os, input_stream, offset, SEEK_SET))
|
||||
|
Reference in New Issue
Block a user