summaryrefslogtreecommitdiff
path: root/src/decoder/DecoderAPI.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-12 16:36:07 +0200
committerMax Kellermann <max@duempel.org>2014-08-12 16:36:07 +0200
commit56f61a6d59cfc6a97005d85599963cafdfdeaba8 (patch)
treec5d4c15e407b5ef6213cc82808af562e2bf85c6d /src/decoder/DecoderAPI.cxx
parent4d5f610029f27f0947bd590b32dbd2179ab379e9 (diff)
PcmConvert: Convert() returns ConstBuffer
Diffstat (limited to 'src/decoder/DecoderAPI.cxx')
-rw-r--r--src/decoder/DecoderAPI.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/decoder/DecoderAPI.cxx b/src/decoder/DecoderAPI.cxx
index b214b91a8..ae600260f 100644
--- a/src/decoder/DecoderAPI.cxx
+++ b/src/decoder/DecoderAPI.cxx
@@ -31,6 +31,7 @@
#include "DetachedSong.hxx"
#include "input/InputStream.hxx"
#include "util/Error.hxx"
+#include "util/ConstBuffer.hxx"
#include "Log.hxx"
#include <assert.h>
@@ -472,9 +473,8 @@ decoder_data(Decoder &decoder,
assert(dc.in_audio_format != dc.out_audio_format);
Error error;
- data = decoder.convert->Convert(data, length,
- &length,
- error);
+ auto result = decoder.convert->Convert({data, length},
+ error);
if (data == nullptr) {
/* the PCM conversion has failed - stop
playback, since we have no better way to
@@ -482,6 +482,9 @@ decoder_data(Decoder &decoder,
LogError(error);
return DecoderCommand::STOP;
}
+
+ data = result.data;
+ length = result.size;
} else {
assert(dc.in_audio_format == dc.out_audio_format);
}