aboutsummaryrefslogtreecommitdiffstats
path: root/alc/voice.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-03-25 21:06:24 -0700
committerChris Robinson <[email protected]>2020-03-25 21:06:24 -0700
commita27096dd6305bbbdc470371ce8807e1e1bf331c1 (patch)
treebcb90f4fe0a88be98edb0838a05989331002dc0c /alc/voice.h
parentcae78e79e81afbc47a9a5802c4cfcc62dbc07f8e (diff)
Dynamically allocate voice channel data
Rather than allocating for a full 8 channels for each voice, when the vast majority will only need 1 or 2. The voice channel data is relatively big since it needs to hold HRTF coefficients and history, and this will allow increasing the maximum number of buffer channels without an obscene memory increase.
Diffstat (limited to 'alc/voice.h')
-rw-r--r--alc/voice.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/alc/voice.h b/alc/voice.h
index 0324f329..6583d4f1 100644
--- a/alc/voice.h
+++ b/alc/voice.h
@@ -226,7 +226,6 @@ struct ALvoice {
/* Properties for the attached buffer(s). */
FmtChannels mFmtChannels;
ALuint mFrequency;
- ALuint mNumChannels;
ALuint mSampleSize;
AmbiLayout mAmbiLayout;
AmbiNorm mAmbiScaling;
@@ -258,7 +257,7 @@ struct ALvoice {
DirectParams mDryParams;
std::array<SendParams,MAX_SENDS> mWetParams;
};
- std::array<ChannelData,MAX_INPUT_CHANNELS> mChans;
+ al::vector<ChannelData> mChans{2};
ALvoice() = default;
ALvoice(const ALvoice&) = delete;