CheckAudioFormat: migrate from class Error to C++ exceptions

This commit is contained in:
Max Kellermann
2016-11-10 11:45:17 +01:00
parent 12f11c97ae
commit cfd51db229
22 changed files with 98 additions and 212 deletions

View File

@@ -29,7 +29,6 @@
#include "input/Reader.hxx"
#include "OggCodec.hxx"
#include "pcm/Interleave.hxx"
#include "util/Error.hxx"
#include "util/Macros.hxx"
#include "util/ScopeExit.hxx"
#include "CheckAudioFormat.hxx"
@@ -166,10 +165,7 @@ VorbisDecoder::SubmitInit()
{
assert(!dsp_initialized);
Error error;
if (!audio_format_init_checked(audio_format, vi.rate, sample_format,
vi.channels, error))
throw std::runtime_error(error.GetMessage());
audio_format = CheckAudioFormat(vi.rate, sample_format, vi.channels);
frame_size = audio_format.GetFrameSize();