diff options
author | Max Kellermann <max@musicpd.org> | 2016-11-10 11:45:17 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-11-10 12:55:08 +0100 |
commit | cfd51db2292aa9ff0b33d2a7ac50a78cafec6015 (patch) | |
tree | 4026d81758898f259622d5cce49f8b052237eaff /src/decoder/plugins/SndfileDecoderPlugin.cxx | |
parent | 12f11c97ae9e5b1b6367e4a5c49713fdd4984b89 (diff) |
CheckAudioFormat: migrate from class Error to C++ exceptions
Diffstat (limited to 'src/decoder/plugins/SndfileDecoderPlugin.cxx')
-rw-r--r-- | src/decoder/plugins/SndfileDecoderPlugin.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/decoder/plugins/SndfileDecoderPlugin.cxx b/src/decoder/plugins/SndfileDecoderPlugin.cxx index ec45270fb..051166c1c 100644 --- a/src/decoder/plugins/SndfileDecoderPlugin.cxx +++ b/src/decoder/plugins/SndfileDecoderPlugin.cxx @@ -23,7 +23,6 @@ #include "input/InputStream.hxx" #include "CheckAudioFormat.hxx" #include "tag/TagHandler.hxx" -#include "util/Error.hxx" #include "util/Domain.hxx" #include "Log.hxx" @@ -201,14 +200,10 @@ sndfile_stream_decode(Decoder &decoder, InputStream &is) return; } - Error error; - AudioFormat audio_format; - if (!audio_format_init_checked(audio_format, info.samplerate, - sndfile_sample_format(info), - info.channels, error)) { - LogError(error); - return; - } + const auto audio_format = + CheckAudioFormat(info.samplerate, + sndfile_sample_format(info), + info.channels); decoder_initialized(decoder, audio_format, info.seekable, sndfile_duration(info)); |