From 56f61a6d59cfc6a97005d85599963cafdfdeaba8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 12 Aug 2014 16:36:07 +0200 Subject: PcmConvert: Convert() returns ConstBuffer --- src/decoder/DecoderAPI.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/decoder') 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 @@ -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); } -- cgit v1.2.3