diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-06-03 13:46:59 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-06-03 13:46:59 -0400 |
commit | 2bd3a3fef6833dff22fa0f6f029d6f2bdfbeef83 (patch) | |
tree | 8508fa134f02f166ec8367547d4a4ffba0a88b34 /libs | |
parent | 10e4aa02ad9da390735655cf24909385e5686062 (diff) |
when AudioSource::read_peaks() provides start+cnt too close to the end, be sure to reset expected_peaks and scale to match the corrected values
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/audiosource.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc index c856ef4d76..f9dcaf23c5 100644 --- a/libs/ardour/audiosource.cc +++ b/libs/ardour/audiosource.cc @@ -376,6 +376,8 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, framecnt_t npeaks, framepos_t cnt = _length - start; read_npeaks = min ((framecnt_t) floor (cnt / samples_per_visual_peak), npeaks); zero_fill = npeaks - read_npeaks; + expected_peaks = (cnt / (double) samples_per_file_peak); + scale = npeaks/expected_peaks; } // cerr << "actual npeaks = " << read_npeaks << " zf = " << zero_fill << endl; |