summaryrefslogtreecommitdiff
path: root/src/filter
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-09-05 12:19:20 +0200
committerMax Kellermann <max@musicpd.org>2016-09-09 14:44:13 +0200
commitae1eb9ccdeb16183ad3faaf8dbf548b1934889db (patch)
tree17456fa28a7a030cbba445512def9c0bb9f8e306 /src/filter
parent860064c8128fd12b2ae6a32d399f01fe6390a223 (diff)
pcm/Convert: migrate from class Error to C++ exceptions
Diffstat (limited to 'src/filter')
-rw-r--r--src/filter/plugins/ConvertFilterPlugin.cxx12
-rw-r--r--src/filter/plugins/ReplayGainFilterPlugin.cxx4
-rw-r--r--src/filter/plugins/VolumeFilterPlugin.cxx5
3 files changed, 4 insertions, 17 deletions
diff --git a/src/filter/plugins/ConvertFilterPlugin.cxx b/src/filter/plugins/ConvertFilterPlugin.cxx
index f4dc37d73..55224de78 100644
--- a/src/filter/plugins/ConvertFilterPlugin.cxx
+++ b/src/filter/plugins/ConvertFilterPlugin.cxx
@@ -25,7 +25,6 @@
#include "pcm/PcmConvert.hxx"
#include "util/Manual.hxx"
#include "util/ConstBuffer.hxx"
-#include "util/Error.hxx"
#include "AudioFormat.hxx"
#include "poison.h"
@@ -88,9 +87,7 @@ ConvertFilter::Set(const AudioFormat &_out_audio_format)
/* optimized special case: no-op */
return;
- Error error;
- if (!state.Open(in_audio_format, _out_audio_format, error))
- throw std::runtime_error(error.GetMessage());
+ state.Open(in_audio_format, _out_audio_format);
out_audio_format = _out_audio_format;
}
@@ -125,12 +122,7 @@ ConvertFilter::FilterPCM(ConstBuffer<void> src)
/* optimized special case: no-op */
return src;
- Error error;
- auto result = state.Convert(src, error);
- if (result.IsNull())
- throw std::runtime_error(error.GetMessage());
-
- return result;
+ return state.Convert(src);
}
const struct filter_plugin convert_filter_plugin = {
diff --git a/src/filter/plugins/ReplayGainFilterPlugin.cxx b/src/filter/plugins/ReplayGainFilterPlugin.cxx
index b6c212c46..4e62d93c2 100644
--- a/src/filter/plugins/ReplayGainFilterPlugin.cxx
+++ b/src/filter/plugins/ReplayGainFilterPlugin.cxx
@@ -76,9 +76,7 @@ public:
mixer(_mixer), base(_base), mode(REPLAY_GAIN_OFF) {
info.Clear();
- Error error;
- if (!pv.Open(out_audio_format.format, error))
- throw std::runtime_error(error.GetMessage());
+ pv.Open(out_audio_format.format);
}
void SetInfo(const ReplayGainInfo *_info) {
diff --git a/src/filter/plugins/VolumeFilterPlugin.cxx b/src/filter/plugins/VolumeFilterPlugin.cxx
index 5ed86d222..64959916f 100644
--- a/src/filter/plugins/VolumeFilterPlugin.cxx
+++ b/src/filter/plugins/VolumeFilterPlugin.cxx
@@ -25,7 +25,6 @@
#include "pcm/Volume.hxx"
#include "AudioFormat.hxx"
#include "util/ConstBuffer.hxx"
-#include "util/Error.hxx"
#include <stdexcept>
@@ -35,9 +34,7 @@ class VolumeFilter final : public Filter {
public:
explicit VolumeFilter(const AudioFormat &audio_format)
:Filter(audio_format) {
- Error error;
- if (!pv.Open(out_audio_format.format, error))
- throw std::runtime_error(error.GetMessage());
+ pv.Open(out_audio_format.format);
}
unsigned GetVolume() const {