1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-16 09:31:14 +01:00

Possibly correct some cases of clicky playback or corrupt recording...

... By reusing portaudio's ring buffer class, which has more safe
inter-thread synchronization with memory fences
This commit is contained in:
Paul Licameli
2018-03-17 23:41:27 -04:00
parent 7b658d7925
commit 6dca4f7859
3 changed files with 72 additions and 3 deletions

View File

@@ -13,6 +13,8 @@
#include "SampleFormat.h"
#include "../lib-src/portaudio-v19/src/common/pa_ringbuffer.h"
class RingBuffer {
public:
RingBuffer(sampleFormat format, size_t size);
@@ -24,7 +26,7 @@ class RingBuffer {
size_t AvailForPut();
size_t Put(samplePtr buffer, sampleFormat format, size_t samples);
size_t Clear(sampleFormat format, size_t samples);
// size_t Clear(sampleFormat format, size_t samples);
//
// For the reader only:
@@ -42,6 +44,8 @@ class RingBuffer {
size_t mEnd { 0 };
size_t mBufferSize;
SampleBuffer mBuffer;
PaUtilRingBuffer mRingBuffer;
};
#endif /* __AUDACITY_RING_BUFFER__ */