diff options
author | Max Kellermann <max@duempel.org> | 2013-11-11 16:15:38 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-11-13 21:06:33 +0100 |
commit | d2679f59c5a6c8df7a2140d40ab65a17b8e5c023 (patch) | |
tree | 803edccbb6c7d383199eba5f91a8610ee3c63c96 /src/DecoderAPI.cxx | |
parent | 4ee147ea34057c0bcef31afed55f98b025b997dc (diff) | |
download | mpd-d2679f59c5a6c8df7a2140d40ab65a17b8e5c023.tar.gz mpd-d2679f59c5a6c8df7a2140d40ab65a17b8e5c023.tar.xz mpd-d2679f59c5a6c8df7a2140d40ab65a17b8e5c023.zip |
PcmConvert: add methods Open(), Close()
Replaces Reset() and eliminates the AudioFormat parameters from the
Convert() method.
Diffstat (limited to 'src/DecoderAPI.cxx')
-rw-r--r-- | src/DecoderAPI.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/DecoderAPI.cxx b/src/DecoderAPI.cxx index 7b850265b..1494e3f80 100644 --- a/src/DecoderAPI.cxx +++ b/src/DecoderAPI.cxx @@ -71,6 +71,12 @@ decoder_initialized(Decoder &decoder, &af_string)); decoder.convert = new PcmConvert(); + + Error error; + if (!decoder.convert->Open(dc.in_audio_format, + dc.out_audio_format, + error)) + decoder.error = std::move(error); } dc.Lock(); @@ -401,9 +407,7 @@ decoder_data(Decoder &decoder, assert(dc.in_audio_format != dc.out_audio_format); Error error; - data = decoder.convert->Convert(dc.in_audio_format, - data, length, - dc.out_audio_format, + data = decoder.convert->Convert(data, length, &length, error); if (data == nullptr) { |