diff options
-rw-r--r-- | core/bformatdec.cpp | 4 | ||||
-rw-r--r-- | core/bformatdec.h | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/core/bformatdec.cpp b/core/bformatdec.cpp index e3f8eaef..ed00566e 100644 --- a/core/bformatdec.cpp +++ b/core/bformatdec.cpp @@ -193,6 +193,6 @@ std::unique_ptr<BFormatDec> BFormatDec::Create(const size_t inchans, const al::span<const ChannelDec> coeffs, const al::span<const ChannelDec> coeffslf, const float xover_f0norm, std::unique_ptr<FrontStablizer> stablizer) { - return std::unique_ptr<BFormatDec>{new(FamCount(inchans)) - BFormatDec{inchans, coeffs, coeffslf, xover_f0norm, std::move(stablizer)}}; + return std::make_unique<BFormatDec>(inchans, coeffs, coeffslf, xover_f0norm, + std::move(stablizer)); } diff --git a/core/bformatdec.h b/core/bformatdec.h index 2cc057f4..0231da1e 100644 --- a/core/bformatdec.h +++ b/core/bformatdec.h @@ -11,6 +11,7 @@ #include "bufferline.h" #include "devformat.h" #include "filters/splitter.h" +#include "vector.h" struct FrontStablizer; @@ -37,13 +38,18 @@ class BFormatDec { const std::unique_ptr<FrontStablizer> mStablizer; const bool mDualBand{false}; - al::FlexArray<ChannelDecoder> mChannelDec; + /* TODO: This should ideally be a FlexArray, since ChannelDecoder is rather + * small and only a few are needed (3, 4, 5, 7, typically). But that can + * only be used in a standard layout struct, and a std::unique_ptr member + * (mStablizer) causes GCC and Clang to warn it's not. + */ + al::vector<ChannelDecoder> mChannelDec; +public: BFormatDec(const size_t inchans, const al::span<const ChannelDec> coeffs, const al::span<const ChannelDec> coeffslf, const float xover_f0norm, std::unique_ptr<FrontStablizer> stablizer); -public: bool hasStablizer() const noexcept { return mStablizer != nullptr; }; /* Decodes the ambisonic input to the given output channels. */ @@ -59,7 +65,7 @@ public: const al::span<const ChannelDec> coeffs, const al::span<const ChannelDec> coeffslf, const float xover_f0norm, std::unique_ptr<FrontStablizer> stablizer); - DEF_FAM_NEWDEL(BFormatDec, mChannelDec) + DEF_NEWDEL(BFormatDec) }; #endif /* CORE_BFORMATDEC_H */ |