diff options
author | Chris Robinson <[email protected]> | 2020-02-17 17:13:00 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-02-17 17:13:25 -0800 |
commit | 3122c3b4a109b7d6e288bdde055fc4bbae5517bc (patch) | |
tree | b2eb3a251a243d3a5f9a7566c343bc614c9ff8cc /al/buffer.cpp | |
parent | c8dfd248185359d86410340741122943524ed10b (diff) |
Handle running the buffer callback in the voice
Diffstat (limited to 'al/buffer.cpp')
-rw-r--r-- | al/buffer.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/al/buffer.cpp b/al/buffer.cpp index b2543434..96c6b4fc 100644 --- a/al/buffer.cpp +++ b/al/buffer.cpp @@ -594,11 +594,8 @@ void PrepareCallback(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq, if UNLIKELY(static_cast<long>(SrcType) != static_cast<long>(DstType)) SETERR_RETURN(context, AL_INVALID_ENUM,, "Unsupported callback format"); - if(!ALBuf->mData.empty()) - { - ALBuf->mData.clear(); - ALBuf->mData.shrink_to_fit(); - } + ALBuf->mData = al::vector<al::byte,16>(FrameSizeFromFmt(DstChannels, DstType) * + size_t{BUFFERSIZE + (MAX_RESAMPLER_PADDING>>1)}); ALBuf->Callback = callback; ALBuf->UserData = userptr; |