Commit b2ae5298 authored by Max Kellermann's avatar Max Kellermann

archive/iso9660: implement seeking

parent 17dd21ac
...@@ -6,6 +6,7 @@ ver 0.21.26 (not yet released) ...@@ -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: ...@@ -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
......
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