mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
AudioRegion::read_peaks() should return 0 or the number of peaks read, not the number of samples
This commit is contained in:
parent
9706125526
commit
88aaf587ad
1 changed files with 8 additions and 7 deletions
|
|
@ -426,15 +426,16 @@ AudioRegion::read_peaks (PeakData *buf, framecnt_t npeaks, framecnt_t offset, fr
|
|||
|
||||
if (audio_source(chan_n)->read_peaks (buf, npeaks, offset, cnt, frames_per_pixel)) {
|
||||
return 0;
|
||||
} else {
|
||||
if (_scale_amplitude != 1.0f) {
|
||||
for (framecnt_t n = 0; n < npeaks; ++n) {
|
||||
buf[n].max *= _scale_amplitude;
|
||||
buf[n].min *= _scale_amplitude;
|
||||
}
|
||||
}
|
||||
|
||||
if (_scale_amplitude != 1.0f) {
|
||||
for (framecnt_t n = 0; n < npeaks; ++n) {
|
||||
buf[n].max *= _scale_amplitude;
|
||||
buf[n].min *= _scale_amplitude;
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
return npeaks;
|
||||
}
|
||||
|
||||
/** @param buf Buffer to write data to (existing data will be overwritten).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue