aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/PcmDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-05 00:06:31 +0200
committerMax Kellermann <max@duempel.org>2013-09-05 00:23:14 +0200
commit7d0269d2cec68c7e55df5b6db3d2266741534b17 (patch)
tree613f5d7b03bc9624f15167c76f8f4309603944cc /src/decoder/PcmDecoderPlugin.cxx
parent52ffdb0a55e43153fa9fc1189316884a630df700 (diff)
downloadmpd-7d0269d2cec68c7e55df5b6db3d2266741534b17.tar.gz
mpd-7d0269d2cec68c7e55df5b6db3d2266741534b17.tar.xz
mpd-7d0269d2cec68c7e55df5b6db3d2266741534b17.zip
InputLegacy: move functions to the input_stream class
Diffstat (limited to 'src/decoder/PcmDecoderPlugin.cxx')
-rw-r--r--src/decoder/PcmDecoderPlugin.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/decoder/PcmDecoderPlugin.cxx b/src/decoder/PcmDecoderPlugin.cxx
index f47b54d03..4fccca75d 100644
--- a/src/decoder/PcmDecoderPlugin.cxx
+++ b/src/decoder/PcmDecoderPlugin.cxx
@@ -20,6 +20,7 @@
#include "config.h"
#include "decoder/PcmDecoderPlugin.hxx"
#include "DecoderAPI.hxx"
+#include "InputStream.hxx"
#include "util/Error.hxx"
extern "C" {
@@ -43,7 +44,7 @@ pcm_stream_decode(struct decoder *decoder, struct input_stream *is)
2,
};
- const char *const mime = input_stream_get_mime_type(is);
+ const char *const mime = is->GetMimeType();
const bool reverse_endian = mime != nullptr &&
strcmp(mime, "audio/x-mpd-cdda-pcm-reverse") == 0;
@@ -52,12 +53,12 @@ pcm_stream_decode(struct decoder *decoder, struct input_stream *is)
const double time_to_size = audio_format.GetTimeToSize();
float total_time = -1;
- const goffset size = input_stream_get_size(is);
+ const goffset size = is->GetSize();
if (size >= 0)
total_time = size / time_to_size;
decoder_initialized(decoder, audio_format,
- input_stream_is_seekable(is), total_time);
+ is->IsSeekable(), total_time);
do {
char buffer[4096];
@@ -65,7 +66,7 @@ pcm_stream_decode(struct decoder *decoder, struct input_stream *is)
size_t nbytes = decoder_read(decoder, is,
buffer, sizeof(buffer));
- if (nbytes == 0 && input_stream_lock_eof(is))
+ if (nbytes == 0 && is->LockIsEOF())
break;
if (reverse_endian)
@@ -83,8 +84,7 @@ pcm_stream_decode(struct decoder *decoder, struct input_stream *is)
decoder_seek_where(decoder));
Error error;
- if (input_stream_lock_seek(is, offset, SEEK_SET,
- error)) {
+ if (is->LockSeek(offset, SEEK_SET, error)) {
decoder_command_finished(decoder);
} else {
g_warning("seeking failed: %s", error.GetMessage());