archive/iso9660: implement seeking
This commit is contained in:
parent
17dd21ac7f
commit
b2ae5298a7
1
NEWS
1
NEWS
@ -6,6 +6,7 @@ ver 0.21.26 (not yet released)
|
|||||||
- bzip2: fix crash on corrupt bzip2 file
|
- bzip2: fix crash on corrupt bzip2 file
|
||||||
- bzip2: flush output at end of input file
|
- bzip2: flush output at end of input file
|
||||||
- iso9660: fix unaligned reads
|
- iso9660: fix unaligned reads
|
||||||
|
- iso9660: support seeking
|
||||||
- zzip: fix crash on corrupt ZIP file
|
- zzip: fix crash on corrupt ZIP file
|
||||||
* decoder
|
* decoder
|
||||||
- sndfile: fix lost samples at end of file
|
- sndfile: fix lost samples at end of file
|
||||||
|
@ -198,12 +198,20 @@ public:
|
|||||||
lsn(_lsn)
|
lsn(_lsn)
|
||||||
{
|
{
|
||||||
size = _size;
|
size = _size;
|
||||||
|
seekable = true;
|
||||||
SetReady();
|
SetReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtual methods from InputStream */
|
/* virtual methods from InputStream */
|
||||||
bool IsEOF() noexcept override;
|
bool IsEOF() noexcept override;
|
||||||
size_t Read(void *ptr, size_t size) override;
|
size_t Read(void *ptr, size_t size) override;
|
||||||
|
|
||||||
|
void Seek(offset_type new_offset) override {
|
||||||
|
if (new_offset > size)
|
||||||
|
throw std::runtime_error("Invalid seek offset");
|
||||||
|
|
||||||
|
offset = new_offset;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
InputStreamPtr
|
InputStreamPtr
|
||||||
|
Loading…
Reference in New Issue
Block a user