diff options
author | Max Kellermann <max@musicpd.org> | 2019-04-04 21:00:23 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-04-04 21:00:23 +0200 |
commit | 00b04468dc2281a09857e1b1d8fea92462568fb2 (patch) | |
tree | 0eb4bf06d7dce6de866c263c6fe345b77a6ee567 /src/filter | |
parent | 8a07724b23d59493666ada922c7c6dcf872157ae (diff) |
filter/Convert: make in_audio_format `const`
Diffstat (limited to 'src/filter')
-rw-r--r-- | src/filter/plugins/ConvertFilterPlugin.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/filter/plugins/ConvertFilterPlugin.cxx b/src/filter/plugins/ConvertFilterPlugin.cxx index 80b28566e..a5e501afd 100644 --- a/src/filter/plugins/ConvertFilterPlugin.cxx +++ b/src/filter/plugins/ConvertFilterPlugin.cxx @@ -35,7 +35,7 @@ class ConvertFilter final : public Filter { * The input audio format; PCM data is passed to the filter() * method in this format. */ - AudioFormat in_audio_format; + const AudioFormat in_audio_format; /** * This object is only "open" if #in_audio_format != @@ -76,7 +76,6 @@ public: void ConvertFilter::Set(const AudioFormat &_out_audio_format) { - assert(in_audio_format.IsValid()); assert(_out_audio_format.IsValid()); if (_out_audio_format == out_audio_format) @@ -100,6 +99,7 @@ ConvertFilter::Set(const AudioFormat &_out_audio_format) ConvertFilter::ConvertFilter(const AudioFormat &audio_format) :Filter(audio_format), in_audio_format(audio_format) { + assert(in_audio_format.IsValid()); } std::unique_ptr<Filter> @@ -112,8 +112,6 @@ PreparedConvertFilter::Open(AudioFormat &audio_format) ConvertFilter::~ConvertFilter() { - assert(in_audio_format.IsValid()); - if (IsActive()) state.Close(); } @@ -121,8 +119,6 @@ ConvertFilter::~ConvertFilter() ConstBuffer<void> ConvertFilter::FilterPCM(ConstBuffer<void> src) { - assert(in_audio_format.IsValid()); - return IsActive() ? state.Convert(src) /* optimized special case: no-op */ |