Permalink
Browse files

BufferStream now seeks forward on read

  • Loading branch information...
nikhilm committed May 29, 2012
1 parent bb366bd commit 7cd69d3c79bc986a4b6ab36bb3276985f2ebc798
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/bufferstream.cc
View
@@ -22,7 +22,9 @@ BufferStream::~BufferStream()
}
TagLib::ByteVector BufferStream::readBlock(TagLib::ulong length) {
- return TagLib::ByteVector(m_data, m_length).mid(m_offset, length);
+ long start = m_offset;
+ m_offset += length;
+ return TagLib::ByteVector(m_data, m_length).mid(start, length);
}
void BufferStream::writeBlock(const TagLib::ByteVector &data) {
@@ -54,8 +56,6 @@ void BufferStream::seek(long offset, TagLib::IOStream::Position p) {
}
void BufferStream::clear() {
- fprintf(stderr, "clear called aborting\n");
- abort();
}
long BufferStream::tell() const {
@@ -67,7 +67,7 @@ long BufferStream::length() {
}
void BufferStream::truncate(long length) {
- fprintf(stderr, "truncaled called aborting\n");
+ fprintf(stderr, "truncate called aborting\n");
abort();
}
}

0 comments on commit 7cd69d3

Please sign in to comment.