mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-16 08:34:10 +02:00
Fixes for new ring buffers...
... A problem was that play button did not pop back up when one of the tracks was mute. Also no longer need mac-specific conditional compilation.
This commit is contained in:
parent
3e680852fd
commit
92d27c618b
@ -31,8 +31,6 @@
|
|||||||
|
|
||||||
#ifdef EXPERIMENTAL_REWRITE_RING_BUFFER
|
#ifdef EXPERIMENTAL_REWRITE_RING_BUFFER
|
||||||
#define REWRITE_RING_BUFFER
|
#define REWRITE_RING_BUFFER
|
||||||
#elif defined (__APPLE__)
|
|
||||||
#define REWRITE_RING_BUFFER
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -162,6 +160,7 @@ size_t RingBuffer::Get(samplePtr buffer, sampleFormat format,
|
|||||||
size_t samplesToCopy)
|
size_t samplesToCopy)
|
||||||
{
|
{
|
||||||
#ifdef REWRITE_RING_BUFFER
|
#ifdef REWRITE_RING_BUFFER
|
||||||
|
samplesToCopy = std::min( samplesToCopy, AvailForGet() );
|
||||||
return PaUtil_ReadRingBuffer(&mRingBuffer, buffer, samplesToCopy);
|
return PaUtil_ReadRingBuffer(&mRingBuffer, buffer, samplesToCopy);
|
||||||
#else
|
#else
|
||||||
samplesToCopy = std::min( samplesToCopy, Len() );
|
samplesToCopy = std::min( samplesToCopy, Len() );
|
||||||
@ -188,6 +187,7 @@ size_t RingBuffer::Get(samplePtr buffer, sampleFormat format,
|
|||||||
size_t RingBuffer::Discard(size_t samplesToDiscard)
|
size_t RingBuffer::Discard(size_t samplesToDiscard)
|
||||||
{
|
{
|
||||||
#ifdef REWRITE_RING_BUFFER
|
#ifdef REWRITE_RING_BUFFER
|
||||||
|
samplesToDiscard = std::min( samplesToDiscard, AvailForGet() );
|
||||||
PaUtil_AdvanceRingBufferReadIndex(&mRingBuffer, samplesToDiscard);
|
PaUtil_AdvanceRingBufferReadIndex(&mRingBuffer, samplesToDiscard);
|
||||||
#else
|
#else
|
||||||
samplesToDiscard = std::min( samplesToDiscard, Len() );
|
samplesToDiscard = std::min( samplesToDiscard, Len() );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user