diff options
author | Chris Robinson <[email protected]> | 2021-12-10 22:07:20 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2021-12-10 22:07:20 -0800 |
commit | a75d35bbb06f74e58cb2232d4ca2ce47950f08cd (patch) | |
tree | a614eccbea22dc181a843a1bb81420b508446ea7 /core/bformatdec.h | |
parent | c005d2c300a17f572ef245f334336a5553555fe9 (diff) |
Use a vector in BFormatDec instead of FlexArray
FlexArray would be better since it's not likely to use much memory for the
array, but the std::unique_ptr makes BFormatDec a non-standard layout, causing
GCC and Clang to complain.
Diffstat (limited to 'core/bformatdec.h')
-rw-r--r-- | core/bformatdec.h | 12 |
1 files changed, 9 insertions, 3 deletions
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 */ |