diff options
author | Max Kellermann <max@duempel.org> | 2013-10-23 22:08:59 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-23 23:12:02 +0200 |
commit | 93deb844996120b6326345d6d87e803142dd1968 (patch) | |
tree | d6c00669efffad1b15fc45e03158d6838a7e5827 /src/decoder/DsdLib.cxx | |
parent | c4d4011c63808a64ca20a4b03fd455a83c23cc33 (diff) | |
download | mpd-93deb844996120b6326345d6d87e803142dd1968.tar.gz mpd-93deb844996120b6326345d6d87e803142dd1968.tar.xz mpd-93deb844996120b6326345d6d87e803142dd1968.zip |
input_stream: rename struct to InputStream
Diffstat (limited to '')
-rw-r--r-- | src/decoder/DsdLib.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/decoder/DsdLib.cxx b/src/decoder/DsdLib.cxx index ab1a132fc..81ea9e5e8 100644 --- a/src/decoder/DsdLib.cxx +++ b/src/decoder/DsdLib.cxx @@ -51,7 +51,7 @@ dsdlib_id_equals(const struct dsdlib_id *id, const char *s) } bool -dsdlib_read(Decoder *decoder, struct input_stream *is, +dsdlib_read(Decoder *decoder, InputStream &is, void *data, size_t length) { size_t nbytes = decoder_read(decoder, is, data, length); @@ -62,27 +62,27 @@ dsdlib_read(Decoder *decoder, struct input_stream *is, * Skip the #input_stream to the specified offset. */ bool -dsdlib_skip_to(Decoder *decoder, struct input_stream *is, +dsdlib_skip_to(Decoder *decoder, InputStream &is, int64_t offset) { - if (is->IsSeekable()) - return is->Seek(offset, SEEK_SET, IgnoreError()); + if (is.IsSeekable()) + return is.Seek(offset, SEEK_SET, IgnoreError()); - if (is->GetOffset() > offset) + if (is.GetOffset() > offset) return false; char buffer[8192]; - while (is->GetOffset() < offset) { + while (is.GetOffset() < offset) { size_t length = sizeof(buffer); - if (offset - is->GetOffset() < (int64_t)length) - length = offset - is->GetOffset(); + if (offset - is.GetOffset() < (int64_t)length) + length = offset - is.GetOffset(); size_t nbytes = decoder_read(decoder, is, buffer, length); if (nbytes == 0) return false; } - assert(is->GetOffset() == offset); + assert(is.GetOffset() == offset); return true; } @@ -90,7 +90,7 @@ dsdlib_skip_to(Decoder *decoder, struct input_stream *is, * Skip some bytes from the #input_stream. */ bool -dsdlib_skip(Decoder *decoder, struct input_stream *is, +dsdlib_skip(Decoder *decoder, InputStream &is, int64_t delta) { assert(delta >= 0); @@ -98,8 +98,8 @@ dsdlib_skip(Decoder *decoder, struct input_stream *is, if (delta == 0) return true; - if (is->IsSeekable()) - return is->Seek(delta, SEEK_CUR, IgnoreError()); + if (is.IsSeekable()) + return is.Seek(delta, SEEK_CUR, IgnoreError()); char buffer[8192]; while (delta > 0) { @@ -124,7 +124,7 @@ dsdlib_skip(Decoder *decoder, struct input_stream *is, #ifdef HAVE_ID3TAG void -dsdlib_tag_id3(struct input_stream *is, +dsdlib_tag_id3(InputStream &is, const struct tag_handler *handler, void *handler_ctx, int64_t tagoffset) { @@ -140,8 +140,8 @@ dsdlib_tag_id3(struct input_stream *is, id3_length_t count; /* Prevent broken files causing problems */ - const auto size = is->GetSize(); - const auto offset = is->GetOffset(); + const auto size = is.GetSize(); + const auto offset = is.GetOffset(); if (offset >= size) return; |