Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions include/flucoma/clients/nrt/BufComposeClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ class BufComposeClient : public FluidBaseClient, OfflineIn, OfflineOut
index nChannels{0};
index nFrames{0};

double sourceSR;

{
BufferAdaptor::ReadAccess source(get<kSource>().get());

Expand All @@ -106,6 +108,8 @@ class BufComposeClient : public FluidBaseClient, OfflineIn, OfflineOut
if (get<kStartChan>() >= source.numChans())
return {Result::Status::kError, "Start channel ", get<kStartChan>(),
" out of range."};

sourceSR = source.sampleRate();
}

index dstStart = get<kDestOffset>();
Expand Down Expand Up @@ -161,7 +165,7 @@ class BufComposeClient : public FluidBaseClient, OfflineIn, OfflineOut

// Access sources inside own scope block, so they'll be unlocked before
// we need to (possibly) resize the desintation buffer which could
// (possibly) also be one of the sources
// (possibly) also be one of the sources
{
BufferAdaptor::ReadAccess source(get<kSource>().get());
auto gain = get<kGain>();
Expand Down Expand Up @@ -199,7 +203,7 @@ class BufComposeClient : public FluidBaseClient, OfflineIn, OfflineOut
{
Result resizeResult =
destination.resize(destinationOrig.cols(), destinationOrig.rows(),
destination.sampleRate());
sourceSR);
if (!resizeResult.ok()) return resizeResult;
for (index i = 0; i < destination.numChans(); ++i)
destination.samps(i) <<= destinationOrig.row(i);
Expand Down