diff options
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; |