aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm/PcmBuffer.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/pcm/PcmBuffer.hxx')
-rw-r--r--src/pcm/PcmBuffer.hxx23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/pcm/PcmBuffer.hxx b/src/pcm/PcmBuffer.hxx
index ae7030f76..2eddfb7f9 100644
--- a/src/pcm/PcmBuffer.hxx
+++ b/src/pcm/PcmBuffer.hxx
@@ -20,33 +20,22 @@
#ifndef PCM_BUFFER_HXX
#define PCM_BUFFER_HXX
-#include "check.h"
+#include "util/ReusableArray.hxx"
#include "gcc.h"
-#include <glib.h>
-
-#include <assert.h>
+#include <stdint.h>
/**
* Manager for a temporary buffer which grows as needed. We could
* allocate a new buffer every time pcm_convert() is called, but that
* would put too much stress on the allocator.
*/
-struct PcmBuffer {
- void *buffer;
-
- size_t size;
-
- PcmBuffer():buffer(nullptr), size(0) {}
-
- ~PcmBuffer() {
- g_free(buffer);
- }
+class PcmBuffer {
+ ReusableArray<uint8_t, 8192> buffer;
+public:
void Clear() {
- g_free(buffer);
- buffer = nullptr;
- size = 0;
+ buffer.Clear();
}
/**