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:
@@ -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__ */
|
||||
|
||||
Reference in New Issue
Block a user