diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2020-03-31 20:51:13 -0600 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2020-03-31 20:54:14 -0600 |
commit | 88e84067f29e5afb8a5a165988c9f46a5964a42f (patch) | |
tree | 873b4c3f2451bea1140e1e8f75c8d1d689fbf639 /libs/ardour/disk_reader.cc | |
parent | 370f7bb30f10bb3e79668edd4d118b15bb3d456c (diff) |
if a locate brings us within a heuristic-specified distance of the current position in a DiskReader, pay attention to loop status
If the last read was not looped, but the new one should be, we need to ignore the heuristic. Ditto for vice-versa.
This isomorphic with the read-reversed case
Diffstat (limited to 'libs/ardour/disk_reader.cc')
-rw-r--r-- | libs/ardour/disk_reader.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/ardour/disk_reader.cc b/libs/ardour/disk_reader.cc index 02805c3bcd..0eba91d3d2 100644 --- a/libs/ardour/disk_reader.cc +++ b/libs/ardour/disk_reader.cc @@ -743,19 +743,20 @@ DiskReader::seek (samplepos_t sample, bool complete_refill) ChannelList::iterator chan; boost::shared_ptr<ChannelList> c = channels.reader(); const bool read_reversed = !_session.transport_will_roll_forwards (); + const bool read_loop = (bool) _loop_location; if (c->empty()) { return 0; } - if (_last_read_reversed && (_last_read_reversed == read_reversed)) { + if ((!_last_read_reversed && (_last_read_reversed != read_reversed)) || + (!_last_read_loop && (_last_read_loop != read_loop))) { /* We do these things only if we're still reading in the same * direction we did last time. */ if (sample == playback_sample && !complete_refill) { - return 0; } @@ -1023,6 +1024,8 @@ DiskReader::audio_read (Sample* sum_buffer, } _last_read_reversed = reversed; + _last_read_loop = (bool) loc; + return rcnt; } |