diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2011-04-25 15:21:25 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2011-04-25 17:51:08 +0400 |
commit | fcd5e81b666fa644b5423e990f6dd074b301ffe2 (patch) | |
tree | eb0f3f56e3a42a2e3d5e5c162ed73f3cc62e8780 /common | |
parent | 2c6c5f984f56572d74f814cf052ddfae2c561948 (diff) |
Buffer PCM data before sending it to the renderer.
Collect at least 16ms of PCM data, and try to get a number of samples so that the duration does not require rounding.
This fixes a problem with certain DSP plugins that don't properly process very short samples or properly handle rounding.
Diffstat (limited to 'common')
-rw-r--r-- | common/DSUtilLite/growarray.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/DSUtilLite/growarray.h b/common/DSUtilLite/growarray.h index 9b1afca5..eeff3638 100644 --- a/common/DSUtilLite/growarray.h +++ b/common/DSUtilLite/growarray.h @@ -52,6 +52,17 @@ public: return hr; } + HRESULT Append(GrowableArray<T> *other) + { + HRESULT hr = S_OK; + DWORD old = GetCount(); + hr = SetSize(old + other->GetCount()); + if (SUCCEEDED(hr)) + memcpy(m_pArray + old, other->Ptr(), other->GetCount()); + + return S_OK; + } + DWORD GetCount() const { return m_count; } // Accessor. |