aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/MadDecoderPlugin.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/MadDecoderPlugin.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/MadDecoderPlugin.cxx')
-rw-r--r--src/decoder/MadDecoderPlugin.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/decoder/MadDecoderPlugin.cxx b/src/decoder/MadDecoderPlugin.cxx
index 381a5703f..8e390d52d 100644
--- a/src/decoder/MadDecoderPlugin.cxx
+++ b/src/decoder/MadDecoderPlugin.cxx
@@ -20,6 +20,7 @@
#include "config.h"
#include "MadDecoderPlugin.hxx"
#include "DecoderAPI.hxx"
+#include "InputStream.hxx"
#include "conf.h"
#include "tag/TagId3.hxx"
#include "tag/TagRva2.hxx"
@@ -205,8 +206,7 @@ inline bool
MadDecoder::Seek(long offset)
{
Error error;
- if (!input_stream_lock_seek(input_stream, offset, SEEK_SET,
- error))
+ if (!input_stream->LockSeek(offset, SEEK_SET, error))
return false;
mad_stream_buffer(&stream, input_buffer, 0);
@@ -776,7 +776,7 @@ mp3_frame_duration(const struct mad_frame *frame)
inline goffset
MadDecoder::ThisFrameOffset() const
{
- goffset offset = input_stream_get_offset(input_stream);
+ goffset offset = input_stream->GetOffset();
if (stream.this_frame != nullptr)
offset -= stream.bufend - stream.this_frame;
@@ -789,7 +789,7 @@ MadDecoder::ThisFrameOffset() const
inline goffset
MadDecoder::RestIncludingThisFrame() const
{
- return input_stream_get_size(input_stream) - ThisFrameOffset();
+ return input_stream->GetSize() - ThisFrameOffset();
}
inline void
@@ -857,8 +857,7 @@ MadDecoder::DecodeFirstFrame(Tag **tag)
}
if (parse_lame(&lame, &ptr, &bitlen)) {
- if (gapless_playback &&
- input_stream_is_seekable(input_stream)) {
+ if (gapless_playback && input_stream->IsSeekable()) {
drop_start_samples = lame.encoder_delay +
DECODERDELAY;
drop_end_samples = lame.encoder_padding;
@@ -1059,7 +1058,7 @@ MadDecoder::Read()
if (cmd == DECODE_COMMAND_SEEK) {
unsigned long j;
- assert(input_stream_is_seekable(input_stream));
+ assert(input_stream->IsSeekable());
j = TimeToFrame(decoder_seek_where(decoder));
if (j < highest_frame) {
@@ -1139,7 +1138,7 @@ mp3_decode(struct decoder *decoder, struct input_stream *input_stream)
}
decoder_initialized(decoder, audio_format,
- input_stream_is_seekable(input_stream),
+ input_stream->IsSeekable(),
data.total_time);
if (tag != nullptr) {