diff options
Diffstat (limited to 'src/decoder/plugins/AudiofileDecoderPlugin.cxx')
-rw-r--r-- | src/decoder/plugins/AudiofileDecoderPlugin.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/decoder/plugins/AudiofileDecoderPlugin.cxx b/src/decoder/plugins/AudiofileDecoderPlugin.cxx index 262c4a5bf..a3f0ee380 100644 --- a/src/decoder/plugins/AudiofileDecoderPlugin.cxx +++ b/src/decoder/plugins/AudiofileDecoderPlugin.cxx @@ -92,13 +92,17 @@ audiofile_file_destroy(AFvirtualfile *vfile) } static AFfileoffset -audiofile_file_seek(AFvirtualfile *vfile, AFfileoffset offset, int is_relative) +audiofile_file_seek(AFvirtualfile *vfile, AFfileoffset _offset, + int is_relative) { InputStream &is = *(InputStream *)vfile->closure; - int whence = (is_relative ? SEEK_CUR : SEEK_SET); + + InputStream::offset_type offset = _offset; + if (is_relative) + offset += is.GetOffset(); Error error; - if (is.LockSeek(offset, whence, error)) { + if (is.LockSeek(offset, IgnoreError())) { return is.GetOffset(); } else { return -1; |