diff options
author | Max Kellermann <max@duempel.org> | 2014-05-11 18:34:09 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-05-12 18:59:46 +0200 |
commit | 0b4fa41aff35ac8d190e5daaeed12f12614a0e9c (patch) | |
tree | 02da5a37e93198e969a28072b555595292ce688b /src/input/plugins/RewindInputPlugin.cxx | |
parent | e138e2c880d2e5ae4728bd821e3a2789cb605a11 (diff) | |
download | mpd-0b4fa41aff35ac8d190e5daaeed12f12614a0e9c.tar.gz mpd-0b4fa41aff35ac8d190e5daaeed12f12614a0e9c.tar.xz mpd-0b4fa41aff35ac8d190e5daaeed12f12614a0e9c.zip |
InputStream: "protect" attributes
Diffstat (limited to 'src/input/plugins/RewindInputPlugin.cxx')
-rw-r--r-- | src/input/plugins/RewindInputPlugin.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/input/plugins/RewindInputPlugin.cxx b/src/input/plugins/RewindInputPlugin.cxx index 80f3beea1..eee395a8b 100644 --- a/src/input/plugins/RewindInputPlugin.cxx +++ b/src/input/plugins/RewindInputPlugin.cxx @@ -93,7 +93,7 @@ private: * buffer contain more data for the next read operation? */ bool ReadingFromBuffer() const { - return tail > 0 && offset < input->offset; + return tail > 0 && offset < input->GetOffset(); } /** @@ -116,7 +116,7 @@ private: SetReady(); } - offset = src->offset; + offset = src->GetOffset(); } }; @@ -127,7 +127,7 @@ RewindInputStream::Read(void *ptr, size_t read_size, Error &error) /* buffered read */ assert(head == (size_t)offset); - assert(tail == (size_t)input->offset); + assert(tail == (size_t)input->GetOffset()); if (read_size > tail - head) read_size = tail - head; @@ -142,7 +142,7 @@ RewindInputStream::Read(void *ptr, size_t read_size, Error &error) size_t nbytes = input->Read(ptr, read_size, error); - if (input->offset > (InputPlugin::offset_type)sizeof(buffer)) + if (input->GetOffset() > (offset_type)sizeof(buffer)) /* disable buffering */ tail = 0; else if (tail == (size_t)offset) { @@ -151,7 +151,7 @@ RewindInputStream::Read(void *ptr, size_t read_size, Error &error) memcpy(buffer + tail, ptr, nbytes); tail += nbytes; - assert(tail == (size_t)input->offset); + assert(tail == (size_t)input->GetOffset()); } CopyAttributes(); @@ -172,7 +172,7 @@ RewindInputStream::Seek(InputPlugin::offset_type new_offset, int whence, assert(!ReadingFromBuffer() || head == (size_t)offset); - assert(tail == (size_t)input->offset); + assert(tail == (size_t)input->GetOffset()); head = (size_t)new_offset; offset = new_offset; @@ -194,7 +194,7 @@ InputStream * input_rewind_open(InputStream *is) { assert(is != nullptr); - assert(is->offset == 0); + assert(is->GetOffset() == 0); if (is->IsReady() && is->IsSeekable()) /* seekable resources don't need this plugin */ |