mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
minor optimization tweak for metering
git-svn-id: svn://localhost/ardour2/branches/3.0@3814 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
a09bc7ef13
commit
ce693248dc
1 changed files with 6 additions and 4 deletions
|
|
@ -35,12 +35,12 @@ namespace ARDOUR {
|
|||
void
|
||||
PeakMeter::run_in_place (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset)
|
||||
{
|
||||
size_t meterable = std::min((size_t)bufs.count().n_total(), _peak_power.size());
|
||||
|
||||
size_t n = 0;
|
||||
size_t meterable = std::min((size_t)bufs.count().n_total(), _peak_power.size());
|
||||
size_t limit = std::min (meterable, bufs.count().n_midi());
|
||||
|
||||
// Meter what we have (midi)
|
||||
for ( ; n < meterable && n < bufs.count().n_midi(); ++n) {
|
||||
for ( ; n < limit; ++n) {
|
||||
|
||||
float val = 0;
|
||||
|
||||
|
|
@ -64,8 +64,10 @@ PeakMeter::run_in_place (BufferSet& bufs, nframes_t start_frame, nframes_t end_f
|
|||
|
||||
}
|
||||
|
||||
limit = std::min (meterable, bufs.count().n_audio());
|
||||
|
||||
// Meter what we have (audio)
|
||||
for ( ; n < meterable && n < bufs.count().n_audio(); ++n) {
|
||||
for ( ; n < limit; ++n) {
|
||||
_peak_power[n] = compute_peak (bufs.get_audio(n).data(nframes, offset), nframes, _peak_power[n]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue