From c7cebfde022d5b255e9c478bcf83391da952dbe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Fri, 27 Aug 2021 02:30:18 +0200 Subject: Update akode seek method semantics. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko Signed-off-by: Michele Calgaro (cherry picked from commit 87208f36caa2451854e949bc270068d2712ebfc4) --- akode_artsplugin/arts_inputstream.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/akode_artsplugin/arts_inputstream.h b/akode_artsplugin/arts_inputstream.h index 1f68d177..785378cb 100644 --- a/akode_artsplugin/arts_inputstream.h +++ b/akode_artsplugin/arts_inputstream.h @@ -75,8 +75,8 @@ public: long write(const char*, long) { return -1; } - bool seek(long to, int whence) { - if(!m_open || !seekable()) return false; + ssize_t seek(long to, int whence) { + if(!m_open || !seekable()) return -1; arts_debug("akode: InputStream seeking"); @@ -89,21 +89,21 @@ public: newpos = m_pos + to; break; case SEEK_END: - if (m_len < 0) return false; + if (m_len < 0) return -1; newpos = m_len + to; break; default: - return false; + return -1; } - long s = m_instream.seek(newpos); + ssize_t s = m_instream.seek(newpos); if (s >= 0) { m_pos = s; m_buffer->flush(); - return true; + return s; } else - return false; + return -1; } long position() const { -- cgit v1.2.1