1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-07 12:12:23 +01:00

More uses of min and max

This commit is contained in:
Paul Licameli
2016-09-02 12:50:40 -04:00
parent f372aee9a1
commit 919d77d176
8 changed files with 24 additions and 44 deletions

View File

@@ -438,8 +438,8 @@ bool BlockFile::Read256(float *buffer,
// FIXME: TRAP_ERR ReadSummay() could return fail.
this->ReadSummary(summary);
if (start+len > mSummaryInfo.frames256)
len = mSummaryInfo.frames256 - start;
start = std::min( start, mSummaryInfo.frames256 );
len = std::min( len, mSummaryInfo.frames256 - start );
CopySamples(summary + mSummaryInfo.offset256 + (start * mSummaryInfo.bytesPerFrame),
mSummaryInfo.format,
@@ -478,8 +478,8 @@ bool BlockFile::Read64K(float *buffer,
// FIXME: TRAP_ERR ReadSummay() could return fail.
this->ReadSummary(summary);
if (start+len > mSummaryInfo.frames64K)
len = mSummaryInfo.frames64K - start;
start = std::min( start, mSummaryInfo.frames64K );
len = std::min( len, mSummaryInfo.frames64K - start );
CopySamples(summary + mSummaryInfo.offset64K +
(start * mSummaryInfo.bytesPerFrame),