|
|
@ -75,8 +75,8 @@ public:
|
|
|
|
long write(const char*, long) {
|
|
|
|
long write(const char*, long) {
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bool seek(long to, int whence) {
|
|
|
|
ssize_t seek(long to, int whence) {
|
|
|
|
if(!m_open || !seekable()) return false;
|
|
|
|
if(!m_open || !seekable()) return -1;
|
|
|
|
|
|
|
|
|
|
|
|
arts_debug("akode: InputStream seeking");
|
|
|
|
arts_debug("akode: InputStream seeking");
|
|
|
|
|
|
|
|
|
|
|
@ -89,21 +89,21 @@ public:
|
|
|
|
newpos = m_pos + to;
|
|
|
|
newpos = m_pos + to;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SEEK_END:
|
|
|
|
case SEEK_END:
|
|
|
|
if (m_len < 0) return false;
|
|
|
|
if (m_len < 0) return -1;
|
|
|
|
newpos = m_len + to;
|
|
|
|
newpos = m_len + to;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
long s = m_instream.seek(newpos);
|
|
|
|
ssize_t s = m_instream.seek(newpos);
|
|
|
|
if (s >= 0) {
|
|
|
|
if (s >= 0) {
|
|
|
|
m_pos = s;
|
|
|
|
m_pos = s;
|
|
|
|
m_buffer->flush();
|
|
|
|
m_buffer->flush();
|
|
|
|
return true;
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return false;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
long position() const {
|
|
|
|
long position() const {
|
|
|
|