diff options
author | Chris Robinson <[email protected]> | 2019-09-10 23:01:33 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-09-10 23:01:33 -0700 |
commit | 65374dc5d00a2fa64657d4310f7a27c09eaa4c9a (patch) | |
tree | 9395affa72e8a0477ec25dc4b5aeaa26fdea09f8 /alc/converter.h | |
parent | 19e1cd7430a19cb3592b4bd3e737e2a0e4314a91 (diff) |
Avoid dynamically allocating ChannelConverter
Diffstat (limited to 'alc/converter.h')
-rw-r--r-- | alc/converter.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/alc/converter.h b/alc/converter.h index 50254213..62f09af1 100644 --- a/alc/converter.h +++ b/alc/converter.h @@ -58,17 +58,9 @@ struct ChannelConverter { DevFmtChannels mSrcChans; DevFmtChannels mDstChans; - ChannelConverter(DevFmtType srctype, DevFmtChannels srcchans, DevFmtChannels dstchans) - : mSrcType(srctype), mSrcChans(srcchans), mDstChans(dstchans) - { } + bool is_active() const noexcept { return mSrcChans != mDstChans; } void convert(const ALvoid *src, ALfloat *dst, ALuint frames) const; - - DEF_NEWDEL(ChannelConverter) }; -using ChannelConverterPtr = std::unique_ptr<ChannelConverter>; - -ChannelConverterPtr CreateChannelConverter(DevFmtType srcType, DevFmtChannels srcChans, - DevFmtChannels dstChans); #endif /* CONVERTER_H */ |