InputStream: make Seek() always absolute

Remove the "whence" parameter that is not actually necessary, and only
complicates the InputStream implementations.
This commit is contained in:
Max Kellermann
2014-05-22 10:10:16 +02:00
parent 374c6a27db
commit 07b93dcf80
28 changed files with 184 additions and 127 deletions

View File

@@ -30,9 +30,7 @@
#include "tag/TagId3.hxx"
#include "util/Error.hxx"
#include <unistd.h>
#include <string.h>
#include <stdio.h> /* for SEEK_SET, SEEK_CUR */
#ifdef HAVE_ID3TAG
#include <id3tag.h>
@@ -63,7 +61,7 @@ dsdlib_skip_to(Decoder *decoder, InputStream &is,
int64_t offset)
{
if (is.IsSeekable())
return is.Seek(offset, SEEK_SET, IgnoreError());
return is.Seek(offset, IgnoreError());
if (is.GetOffset() > offset)
return false;
@@ -96,7 +94,7 @@ dsdlib_skip(Decoder *decoder, InputStream &is,
return true;
if (is.IsSeekable())
return is.Seek(delta, SEEK_CUR, IgnoreError());
return is.Seek(is.GetOffset() + delta, IgnoreError());
char buffer[8192];
while (delta > 0) {