mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-05 22:28:57 +02:00
More cautions in SBSMSEffect.cpp...
... The narrowings from sampleCount to long might be fixed, but it would require changes in lib-src
This commit is contained in:
parent
5ef9b81a94
commit
2949a080d2
@ -301,9 +301,6 @@ bool EffectSBSMS::Process()
|
||||
SlideType outSlideType;
|
||||
SBSMSResampleCB outResampleCB;
|
||||
|
||||
sampleCount processPresamples = 0;
|
||||
sampleCount trackPresamples = 0;
|
||||
|
||||
if(bLinkRatePitch) {
|
||||
rb.bPitch = true;
|
||||
outSlideType = rateSlideType;
|
||||
@ -327,10 +324,18 @@ bool EffectSBSMS::Process()
|
||||
rb.SBSMSBlockSize = rb.sbsms->getInputFrameSize();
|
||||
rb.SBSMSBuf = (audio*)calloc(rb.SBSMSBlockSize,sizeof(audio));
|
||||
|
||||
processPresamples = wxMin(rb.quality->getMaxPresamples(),
|
||||
(long)((float)(start-trackStart)*(srProcess/srTrack)));
|
||||
trackPresamples = wxMin(start-trackStart,
|
||||
(long)((float)(processPresamples)*(srTrack/srProcess)));
|
||||
// Note: width of getMaxPresamples() is only long. Widen it
|
||||
decltype(start) processPresamples = rb.quality->getMaxPresamples();
|
||||
processPresamples =
|
||||
std::min(processPresamples,
|
||||
decltype(processPresamples)
|
||||
((float)(start-trackStart)*(srProcess/srTrack)));
|
||||
|
||||
auto trackPresamples = start - trackStart;
|
||||
trackPresamples =
|
||||
std::min(trackPresamples,
|
||||
decltype(trackPresamples)
|
||||
((float)(processPresamples)*(srTrack/srProcess)));
|
||||
rb.offset = start - trackPresamples;
|
||||
rb.end = trackEnd;
|
||||
rb.iface = std::make_unique<SBSMSEffectInterface>
|
||||
@ -340,7 +345,9 @@ bool EffectSBSMS::Process()
|
||||
// The argument type is only long!
|
||||
static_cast<long> ( static_cast<size_t> (
|
||||
samplesToProcess ) ),
|
||||
processPresamples,
|
||||
// This argument type is also only long!
|
||||
static_cast<long> ( static_cast<size_t> (
|
||||
processPresamples ) ),
|
||||
rb.quality.get());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user