Remove clamp macro
Doesn't really need to exist since all it's doing is inlining std::clamp.
This commit is contained in:
@@ -312,7 +312,7 @@ int Alsa9Buf::GetNumFramesToFill()
|
||||
const snd_pcm_sframes_t filled_frames = std::max( 0l, total_frames - avail_frames );
|
||||
|
||||
/* Number of frames that don't have data, that are within the writeahead: */
|
||||
snd_pcm_sframes_t unfilled_frames = clamp( ActualWriteahead - filled_frames, 0l, (snd_pcm_sframes_t)ActualWriteahead );
|
||||
snd_pcm_sframes_t unfilled_frames = std::clamp( ActualWriteahead - filled_frames, 0l, (snd_pcm_sframes_t)ActualWriteahead );
|
||||
|
||||
// LOG->Trace( "total_fr: %i; avail_fr: %i; filled_fr: %i; ActualWr %i; chunksize %i; unfilled_frames %i ",
|
||||
// total_frames, avail_frames, filled_frames, ActualWriteahead, chunksize, unfilled_frames );
|
||||
|
||||
@@ -95,7 +95,7 @@ RageSoundMixBuffer &RageSoundDriver::MixIntoBuffer( int iFrames, std::int64_t iF
|
||||
const std::int64_t iFramesUntilThisBuffer = iFrameNumber - iCurrentFrame;
|
||||
const float fSecondsBeforeStart = -s.m_StartTime.Ago();
|
||||
const std::int64_t iFramesBeforeStart = std::int64_t(fSecondsBeforeStart * GetSampleRate());
|
||||
const int iSilentFramesInThisBuffer = clamp( int(iFramesBeforeStart-iFramesUntilThisBuffer), 0, iFramesLeft );
|
||||
const int iSilentFramesInThisBuffer = std::clamp( int(iFramesBeforeStart-iFramesUntilThisBuffer), 0, iFramesLeft );
|
||||
|
||||
iGotFrames += iSilentFramesInThisBuffer;
|
||||
iFramesLeft -= iSilentFramesInThisBuffer;
|
||||
|
||||
Reference in New Issue
Block a user