summaryrefslogtreecommitdiff
path: root/libs/ardour/audiosource.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-07-29 03:48:52 +0200
committerRobin Gareus <robin@gareus.org>2019-07-29 03:48:52 +0200
commita582b24fcddea0fc55b31dd567982227c5e3c890 (patch)
tree3466bb0108ff40dc2c2b79826f99045c4a5fb7f3 /libs/ardour/audiosource.cc
parenta176efee02ac26eabb95585f2852e2e913ceb253 (diff)
Fix rendering of region waveform left-edge
The left-most part may be a partial block of a given "sample per pixel" range. Also previously there was an off-by-one [block] in case sample_pos was an even multiple of samples_per_visual_peak.
Diffstat (limited to 'libs/ardour/audiosource.cc')
-rw-r--r--libs/ardour/audiosource.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc
index aafc639fed..ecb4358d70 100644
--- a/libs/ardour/audiosource.cc
+++ b/libs/ardour/audiosource.cc
@@ -647,9 +647,8 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, samplecnt_t npeaks, samplepos
samplecnt_t chunksize = (samplecnt_t) min (cnt, (samplecnt_t) 4096);
boost::scoped_array<Sample> raw_staging(new Sample[chunksize]);
- samplepos_t sample_pos = start;
- double pixel_pos = floor (sample_pos / samples_per_visual_peak);
- double next_pixel_pos = ceil (sample_pos / samples_per_visual_peak);
+ double pixel_pos = start / samples_per_visual_peak;
+ double next_pixel_pos = 1.0 + floor (pixel_pos);
double pixels_per_sample = 1.0 / samples_per_visual_peak;
xmin = 1.0;